Admin Tools

[configCode]Macのモデル名を取得する


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#モデル名を取得します
#例:"MacBook Pro (13-inch, M1, 2020)"
# BaseURL https://checkcoverage.apple.com
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application

set appFileManager to refMe's NSFileManager's defaultManager()
#################################################
######ファイル保存先 書類>>Apple >> IOPlatformUUID
#################################################
set ocidUserLibraryPathArray to (appFileManager's URLsForDirectory:(refMe's NSDocumentDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidFilePathURL to ocidUserLibraryPathArray's objectAtIndex:0
set ocidSaveDirPathURL to ocidFilePathURL's URLByAppendingPathComponent:"Apple/IOPlatformUUID"
############################
#####属性
set ocidAttrDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
ocidAttrDict's setValue:511 forKey:(refMe's NSFilePosixPermissions)
############################
###フォルダを作る
set listBoolMakeDir to appFileManager's createDirectoryAtURL:(ocidSaveDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error|:(reference)
#####################################
######PLISTパス
#####################################
set ocidFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:"ioreg.plist"
set strFilePath to (ocidFilePathURL's |path|()) as text
###古いファイルはゴミ箱に
set boolResults to (appFileManager's trashItemAtURL:ocidFilePathURL resultingItemURL:(missing value) |error|:(reference))
#####################################
###ioregコマンド実行してシリアル番号を取得
set strCommandText to "/usr/sbin/ioreg -c IOPlatformExpertDevice -a " as text
set strPlistData to (do shell script strCommandText) as text
###戻り値をストリングに
set ocidPlistStrings to refMe's NSString's stringWithString:strPlistData
###NSDATAにして
set ocidPlisStringstData to ocidPlistStrings's dataUsingEncoding:(refMe's NSUTF8StringEncoding)
###ファイルに書き込み(使い回し用)-->不要な場合は削除して
ocidPlisStringstData's writeToURL:ocidFilePathURL atomically:true
###PLIST初期化して
set listResults to refMe's NSPropertyListSerialization's propertyListWithData:(ocidPlisStringstData) options:0 format:(refMe's NSPropertyListXMLFormat_v1_0) |error|:(reference)
###シリアル番号を取得する
set ocidPlistDataArray to item 1 of listResults
set ocidDeviceSerialNumberArray to (ocidPlistDataArray's valueForKeyPath:"IORegistryEntryChildren.IOPlatformSerialNumber")
set ocidDeviceSerialNumber to ocidDeviceSerialNumberArray's firstObject()
###configCodeにする(後ろから4文字)
set intTextlength to (ocidDeviceSerialNumber's |length|) as integer
set ocidRenge to refMe's NSMakeRange((intTextlength - 4), 4)
set strConfigCode to (ocidDeviceSerialNumber's substringWithRange:(ocidRenge)) as text

###################################################
######URLを整形する
set strURL to "https://support-sp.apple.com/sp/product"
set ocidURLStr to refMe's NSString's stringWithString:(strURL)
set ocidURL to refMe's NSURL's URLWithString:(ocidURLStr)
####コンポーネント
set ocidComponents to refMe's NSURLComponents's alloc()'s initWithURL:(ocidURL) resolvingAgainstBaseURL:false
set ocidComponentArray to refMe's NSMutableArray's alloc()'s initWithCapacity:0
##クエリー シリアルの最後の4桁
set ocidQueryItem to refMe's NSURLQueryItem's alloc()'s initWithName:("cc") value:(strConfigCode)
ocidComponentArray's addObject:(ocidQueryItem)
##販売元国コード
set ocidLocale to refMe's NSLocale's currentLocale()
set ocidLocaleID to ocidLocale's localeIdentifier()
set ocidQueryItem to (refMe's NSURLQueryItem's alloc()'s initWithName:("lang") value:(ocidLocaleID))
(ocidComponentArray's addObject:(ocidQueryItem))
###検索クエリーとして追加
(ocidComponents's setQueryItems:(ocidComponentArray))
####コンポーネントをURLに展開
set ocidNewURL to ocidComponents's |URL|()
log ocidNewURL's absoluteString() as text
###XML読み込み
set ocidOption to (refMe's NSXMLDocumentTidyXML)
set listReadXMLDoc to refMe's NSXMLDocument's alloc()'s initWithContentsOfURL:(ocidNewURL) options:(ocidOption) |error|:(reference)
set ocidReadXMLDoc to (item 1 of listReadXMLDoc)
###ROOTエレメント
set ocidRootElement to ocidReadXMLDoc's rootElement()
###子要素の数
set numCntChild to ocidRootElement's childCount() as integer
###第一階層だけの子要素
repeat with numCntChild from 0 to (numCntChild - 1)
log (ocidRootElement's childAtIndex:numCntChild)'s |name| as text
log (ocidRootElement's childAtIndex:numCntChild)'s stringValue as text
end repeat
set ocidConfigCode to ocidRootElement's elementsForName:"configCode"
log ocidConfigCode's stringValue as text



################################
######ダイアログ
################################
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder"
activate
  end tell
else
  tell current application
activate
  end tell
end if

set aliasIconPath to POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/com.apple.imac-g4-20.icns" as alias
try
  set recordResponse to (display dialog "モデル名です" with title "モデル名" default answer (ocidConfigCode's stringValue as text) buttons {"クリップボードにコピー", "OK", "キャンセル"} default button "OK" cancel button "キャンセル" with icon aliasIconPath giving up after 20 without hidden answer)
  
on error
log "エラーしました"
return "エラーしました"
end try
if true is equal to (gave up of recordResponse) then
return "時間切れですやりなおしてください"
end if
if "OK" is equal to (button returned of recordResponse) then
  set strResponse to (text returned of recordResponse) as text
else if button returned of recordResponse is "クリップボードにコピー" then
  set strText to text returned of recordResponse as text
  ####ペーストボード宣言
  set appPasteboard to refMe's NSPasteboard's generalPasteboard()
  ##結果をペーストボードにテキストで入れる
  set ocidText to (refMe's NSString's stringWithString:(strText))
appPasteboard's clearContents()
appPasteboard's setString:(ocidText) forType:(refMe's NSPasteboardTypeString)
return
else
log "キャンセルしました"
return "キャンセルしました"
end if


return (ocidConfigCode's stringValue as text)


|

IORegistryExplorerを開く


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use framework "UniformTypeIdentifiers"
use scripting additions
property refMe : a reference to current application

set strBundleID to "com.apple.IORegistryExplorer" as text

set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace()
set ocidAppBundle to (refMe's NSBundle's bundleWithIdentifier:(strBundleID))
if ocidAppBundle ≠ (missing value) then
  set ocidAppPathURL to ocidAppBundle's bundleURL()
else if ocidAppBundle = (missing value) then
  set ocidAppPathURL to (appSharedWorkspace's URLForApplicationWithBundleIdentifier:(strBundleID))
end if
if ocidAppPathURL = (missing value) then
  tell application "Finder"
    try
      set aliasAppApth to (application file id strBundleID) as alias
    on error
      set aliasIconPath to POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertNoteIcon.icns"
      set strMes to ("https://developer.apple.com/download/all/?q=Additional%20Tools%20for%20Xcode") as text
      set recordResult to (display dialog "【エラー】アプリケーションが見つかりませんでした" with title "アプリケーションが見つかりませんでした\rダウンロードはデベロッパーサイトから" default answer strMes buttons {"リンクを開く", "終了"} default button "リンクを開く" cancel button "終了" giving up after 20 with icon aliasIconPath without hidden answer)
      if button returned of recordResult is "リンクを開く" then
tell application "Finder"
open location strMes
end tell
      end if
return "アプリケーションが見つかりませんでした"
    end try
  end tell
  set strAppPath to POSIX path of aliasAppApth as text
  set strAppPathStr to refMe's NSString's stringWithString:(strAppPath)
  set strAppPath to strAppPathStr's stringByStandardizingPath()
  set ocidAppPathURL to refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:true
end if

set ocidOpenConfig to refMe's NSWorkspaceOpenConfiguration's configuration
(ocidOpenConfig's setActivates:(refMe's NSNumber's numberWithBool:true))
(appSharedWorkspace's openApplicationAtURL:(ocidAppPathURL) configuration:(ocidOpenConfig) completionHandler:(missing value))


|

scutilの情報を取得表示します


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application

#####最初のリスト取得
set strSubKey to doListSelect()
#####最初のコマンド実行
doCommand(strSubKey)

#########################
##リスト 選択
#########################
to doListSelect()
  set strCommandText to ("/bin/echo list | /usr/sbin/scutil") as text
  log strCommandText
  set strResponse to (do shell script strCommandText) as text
  set listChooseList to {} as list
  
  set AppleScript's text item delimiters to "\r"
  set listResponse to every text item of strResponse
  set AppleScript's text item delimiters to ""
  
  repeat with itemResponse in listResponse
    set AppleScript's text item delimiters to "="
    set listTmpSubKey to every text item of itemResponse
    set AppleScript's text item delimiters to ""
    set strSubKey to (item 2 of listTmpSubKey) as text
    set end of listChooseList to strSubKey
  end repeat
  
  try
    ###ダイアログを前面に出す
    tell current application
      set strName to name as text
    end tell
    ####スクリプトメニューから実行したら
    if strName is "osascript" then
      tell application "Finder"
activate
      end tell
    else
      tell current application
activate
      end tell
    end if
    set listResponse to (choose from list listChooseList with title "選んでください" with prompt "設定値を表示します\r選んでください" default items (item 1 of listChooseList) OK button name "OK" cancel button name "キャンセル" without multiple selections allowed and empty selection allowed) as list
  on error
    log "エラーしました"
return "エラーしました"
  end try
  if (item 1 of listResponse) is false then
return "キャンセルしました"
  end if
  
  set theResponse to (item 1 of listResponse) as text
end doListSelect

#########################
##コマンド実行
#########################
to doCommand(argSubKey)
  set strCommandText to ("/bin/echo \"show" & argSubKey & "\" | /usr/sbin/scutil") as text
  log strCommandText
  set strResponse to (do shell script strCommandText) as text
  ###
doDialog(strResponse)
end doCommand

#########################
##戻り値表示
#########################
to doDialog(argResponse)
  tell current application
    set strName to name as text
  end tell
  ####スクリプトメニューから実行したら
  if strName is "osascript" then
    tell application "Finder"
      activate
    end tell
  else
    tell current application
      activate
    end tell
  end if
  set aliasIconPath to POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns" as alias
  try
    set recordResponse to (display dialog "設定内容" with title "設定内容確認" default answer argResponse buttons {"クリップボードにコピー", "終了", "もう一度"} default button "終了" cancel button "終了" with icon aliasIconPath giving up after 20 without hidden answer)
    
  on error
    log "エラーしました"
return "エラーしました"
  end try
  if true is equal to (gave up of recordResponse) then
return "時間切れですやりなおしてください"
  end if
  if "終了" is equal to (button returned of recordResponse) then
    set strResponse to (text returned of recordResponse) as text
return strResponse
  else if button returned of recordResponse is "クリップボードにコピー" then
    set strText to text returned of recordResponse as text
    ####ペーストボード宣言
    set appPasteboard to refMe's NSPasteboard's generalPasteboard()
    ##結果をペーストボードにテキストで入れる
    set ocidText to (refMe's NSString's stringWithString:(strText))
appPasteboard's clearContents()
appPasteboard's setString:(ocidText) forType:(refMe's NSPasteboardTypeString)
return strText
  else if button returned of recordResponse is "もう一度" then
    set strSubKey to doListSelect()
doCommand(strSubKey)
  else
    log "キャンセルしました"
return "キャンセルしました"
  end if
return
end doDialog



|

[nettop]接続中のネットワークサービスの一覧を出力する(修正)


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions


property refMe : a reference to current application


set strCommandText to "/usr/bin/nettop -x -n" as text

tell application "Terminal"
  launch
  activate
  set objTabWindows to do script "\n\n"
  tell objTabWindows
    activate
  end tell
  tell front window
    activate
    set numWidowID to id as integer
  end tell
  
  tell window id numWidowID
    set size to {720, 270}
    set position to {360, 25}
    set origin to {360, 500}
    set frame to {360, 500, 1080, 875}
    set bounds to {360, 25, 1080, 295}
  end tell
  tell objTabWindows
    activate
do script strCommandText in objTabWindows
  end tell
end tell



set strCommandText to "/usr/bin/nettop -m tcp" as text

tell application "Terminal"
  launch
  activate
  set objTabWindows to do script "\n\n"
  tell objTabWindows
    activate
  end tell
  tell front window
    activate
    set numWidowID to id as integer
  end tell
  
  tell window id numWidowID
    set size to {720, 300}
    set position to {360, 300}
    set origin to {360, 300}
    set frame to {360, 300, 1080, 600}
    set bounds to {360, 300, 1080, 600}
  end tell
  tell objTabWindows
    activate
do script strCommandText in objTabWindows
  end tell
end tell
set strCommandText to "/usr/bin/nettop -t wifi" as text

tell application "Terminal"
  launch
  activate
  set objTabWindows to do script "\n\n"
  tell objTabWindows
    activate
  end tell
  tell front window
    activate
    set numWidowID to id as integer
  end tell
  
  tell window id numWidowID
    set size to {720, 300}
    set position to {360, 600}
    set origin to {360, 0}
    set frame to {360, 0, 1080, 300}
    set bounds to {360, 600, 1080, 900}
  end tell
  tell objTabWindows
    activate
do script strCommandText in objTabWindows
  end tell
end tell


set strCommandText to "/usr/bin/man -a nettop"

tell application "Terminal"
  set objTabWindows to do script "\n\n"
  tell front window
    activate
    set numWidowID to id as integer
  end tell
  tell window id numWidowID
    activate
    set size to {360, 870}
    set position to {0, 25}
    set origin to {0, 0}
    set frame to {0, 0, 360, 875}
    set bounds to {0, 25, 360, 900}
  end tell
  tell objTabWindows
    activate
do script strCommandText in objTabWindows
  end tell
end tell
return


|

IPアドレス取得(汎用)


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application


####################################
######Macアドレス取得
###コマンド生成 実行
set strCommandText to "/usr/sbin/networksetup -listallnetworkservices"
set strResults to (do shell script strCommandText) as text
###戻り値を改行でリストに
set ocidListallnetworkservices to refMe's NSString's stringWithString:(strResults)
set ocidChrSet to refMe's NSCharacterSet's characterSetWithCharactersInString:("\r")
set ocidNetworkNameArray to ocidListallnetworkservices's componentsSeparatedByCharactersInSet:(ocidChrSet)
(ocidNetworkNameArray's removeObjectAtIndex:(0))
set strMacAdd to "" as text
repeat with itemNetworkName in ocidNetworkNameArray
  set strServiceName to itemNetworkName as text
  ###コマンド生成 実行
  set strCommandText to "/usr/sbin/networksetup -getinfo \"" & strServiceName & "\"" as text
  set strResponse to (do shell script strCommandText) as text
  ###戻り値を改行でリストに
  set ocidResponse to (refMe's NSString's stringWithString:(strResponse))
  set ocidChrSet to (refMe's NSCharacterSet's characterSetWithCharactersInString:("\r"))
  set ocidResponseArray to (ocidResponse's componentsSeparatedByCharactersInSet:(ocidChrSet))
  repeat with itemResponse in ocidResponseArray
    set strResponse to itemResponse as text
    if strResponse contains "Wi-Fi ID" then
      set strMacAdd to strServiceName & ":" & strResponse & "\r" & strMacAdd as text
    else if strResponse contains "Ethernet Address" then
      set strMacAdd to strServiceName & ":" & strResponse & "\r" & strMacAdd as text
    end if
  end repeat
end repeat

####################################
###### IPアドレス取得
set strURL to "https://www.cloudflare.com/cdn-cgi/trace?json" as text
set ocidURL to refMe's NSURL's URLWithString:(strURL)
###URLをリクエスト
set listContents to refMe's NSString's stringWithContentsOfURL:(ocidURL) encoding:(refMe's NSUTF8StringEncoding) |error|:(reference)
set ocidContents to item 1 of listContents
###改行で
set ocidCharacterSet to refMe's NSCharacterSet's newlineCharacterSet
###リスト化して
set ocidStringArray to ocidContents's componentsSeparatedByCharactersInSet:(ocidCharacterSet)
###IPアドレスを取得
repeat with itemStringArray in ocidStringArray
  if (itemStringArray as text) starts with "ip" then
    set ocidIPArray to (itemStringArray's componentsSeparatedByString:"=")
    set ocidIPAdd to (ocidIPArray's objectAtIndex:1)
  end if
end repeat
###正順 IPアドレス
set strIPAdd to ocidIPAdd as text
set ocidIpAddArray to ocidIPAdd's componentsSeparatedByString:(".")
set ocidIpAddArrayRev to (ocidIpAddArray's reverseObjectEnumerator())'s allObjects()
###逆順 IPアドレス
set strIPAddRev to (ocidIpAddArrayRev's componentsJoinedByString:(".")) as text
####################################
###### URL部分
set strURLrev to ("https://cloudflare-dns.com/dns-query?name=" & strIPAddRev & ".in-addr.arpa&type=PTR") as text
set ocidURLrevStr to refMe's NSString's stringWithString:(strURLrev)
set ocidURLrevURL to refMe's NSURL's URLWithString:(ocidURLrevStr)
####################################
###### URLRequest部分
set ocidURLRequest to refMe's NSMutableURLRequest's alloc()'s init()
ocidURLRequest's setHTTPMethod:("GET")
ocidURLRequest's setURL:(ocidURLrevURL)
ocidURLRequest's addValue:("application/json") forHTTPHeaderField:("Content-Type")
ocidURLRequest's addValue:("application/dns-json") forHTTPHeaderField:("accept")
################################################
repeat 5 times
  ###### データ取得
  set listServerResponse to refMe's NSURLConnection's sendSynchronousRequest:(ocidURLRequest) returningResponse:(missing value) |error|:(reference)
  ###取得JSONデータ
  set ocidJsonResponse to (item 1 of listServerResponse)
  ####取得データをJSONで確定
  set listJsonData to refMe's NSJSONSerialization's JSONObjectWithData:ocidJsonResponse options:(refMe's NSJSONReadingMutableContainers) |error|:(reference)
  set ocidJsonData to (item 1 of listJsonData)
  ####レコードに格納
  set ocidJsonDict to refMe's NSDictionary's alloc()'s initWithDictionary:(ocidJsonData)
  set numStatus to (ocidJsonDict's valueForKey:("Status")) as integer
  if numStatus = 0 then
    set ocidRevHost to (ocidJsonDict's valueForKey:("Question"))'s valueForKey:("name")
    set strRevHost to ocidRevHost as text
    exit repeat
  else
    delay 1
  end if
end repeat
if numStatus ≠ 0 then
  display alert "データの取得に失敗しました" giving up after 3
return "データの取得に失敗しました"
end if
###ホスト名解決
set strCommandText to ("/usr/bin/dig -x " & strIPAdd & " +short")
set strHostName to (do shell script strCommandText) as text

set strCommandText to ("/sbin/ifconfig | grep \"inet.*broadcast\" | awk '{print $2}'") as text
set strLocalIP to (do shell script strCommandText) as text

set strAns to ("ホスト名:" & strHostName & "\rグローバルIP:" & strIPAdd & "\r逆引き:" & strRevHost & "\rローカルIP:" & strLocalIP & "\r" & strMacAdd) as text
##############################
#####ダイアログを前面に出す
##############################
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder"
    activate
  end tell
else
  tell current application
    activate
  end tell
end if
################################
######ダイアログ
################################
set aliasIconPath to POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns" as alias
try
  set recordResponse to (display dialog strAns with title "IPアドレス" default answer strAns buttons {"クリップボードにコピー", "OK", "キャンセル"} default button "OK" cancel button "キャンセル" with icon aliasIconPath giving up after 20 without hidden answer)
on error
  log "エラーしました"
return "エラーしました"
end try
if true is equal to (gave up of recordResponse) then
return "時間切れですやりなおしてください"
end if
if "OK" is equal to (button returned of recordResponse) then
  set strResponse to (text returned of recordResponse) as text
else if button returned of recordResponse is "クリップボードにコピー" then
  set strText to text returned of recordResponse as text
  ####ペーストボード宣言
  set appPasteboard to refMe's NSPasteboard's generalPasteboard()
  ##結果をペーストボードにテキストで入れる
  set ocidText to (refMe's NSString's stringWithString:(strText))
appPasteboard's clearContents()
appPasteboard's setString:(ocidText) forType:(refMe's NSPasteboardTypeString)
return strText
else
  log "キャンセルしました"
return "キャンセルしました" & strText
end if





|

ネットワーク スピードテスト(修正 コマンドオプションを-s -v変更)


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions
property refMe : a reference to current application

###ダイアログを前面に出す
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder"
    activate
  end tell
else
  tell current application
    activate
  end tell
end if
set strAlertMes to "処理が終わるまで30秒ほどかかります" as text
display alert ("【処理を開始します】\r" & strAlertMes) buttons {"OK", "キャンセル"} default button "OK" cancel button "キャンセル" as informational giving up after 2

set strCommandText to "/usr/bin/networkQuality -s -v" as text
set strResponse to (do shell script strCommandText) as text
###改行でリスト化
set AppleScript's text item delimiters to "\r"
set listResponse to every text item of strResponse
set AppleScript's text item delimiters to ""
###出力初期化
set strOutPutText to "" as text
set strDownlink to "" as text
set strUplink to "" as text
###SUMMARY行以前は出力しない
set boolSUMMARY to false as boolean
###出力行の数だけ繰り返し
repeat with itemLineText in listResponse
  if itemLineText contains "=" then
    set boolSUMMARY to true as boolean
  end if
  if itemLineText starts with "Downlink bytes" then
    set strDownlink to itemLineText as text
  end if
  if itemLineText starts with "Uplink bytes" then
    set strUplink to itemLineText as text
  end if
  if boolSUMMARY is true then
    set strOutPutText to strOutPutText & itemLineText & "\r" as text
  end if
end repeat

###ダイアログへ戻す
set strMes to ("ネットワーク スピードテスト\r" & strDownlink & "\r" & strUplink & "\r") as text
###表示用アイコン
set aliasIconPath to POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericNetworkIcon.icns" as alias
try
  #####ダイアログを前面に
  tell current application
    set strName to name as text
  end tell
  ####スクリプトメニューから実行したら
  if strName is "osascript" then
    tell application "Finder" to activate
  else
    tell current application to activate
  end if
  set recordResult to (display dialog strMes with title "ネットワーク スピードテスト" default answer strOutPutText buttons {"クリップボードにコピー", "キャンセル", "OK"} default button "OK" cancel button "キャンセル" with icon aliasIconPath giving up after 20 without hidden answer)
on error
  log "エラーしました"
return
end try
if true is equal to (gave up of recordResult) then
return "時間切れですやりなおしてください"
end if
if "OK" is equal to (button returned of recordResult) then
  set theResponse to (text returned of recordResult) as text
else if button returned of recordResult is "クリップボードにコピー" then
  try
    set strText to text returned of recordResult as text
    ####ペーストボード宣言
    set appPasteboard to refMe's NSPasteboard's generalPasteboard()
    set ocidText to (refMe's NSString's stringWithString:(strText))
appPasteboard's clearContents()
appPasteboard's setString:(ocidText) forType:(refMe's NSPasteboardTypeString)
  on error
    tell application "Finder"
      set the clipboard to strTitle as text
    end tell
  end try
else
return "キャンセル"
end if





|

[Office]SaveAsAdobePDF.ppam が読み込めませんでした。(修正版)

SaveAsAdobePDF.ppam が読み込めませんでした。
SaveAsAdobePDF.xlam が読み込めませんでした
linkCreation.dotm が読み込めませんでした 対応用

基本的には『リセットツール』を使えば解決できるのですが

Factory Reset Package
Complete Removal Package
Word Reset Package
Excel Reset Package
PowerPoint Reset Package
Outlook Reset Package
Outlook Data Removal Package
OneNote Reset Package
OneDrive Reset Package
Teams Reset Package
Skype For Business Removal Package
AutoUpdate Reset Package
License Reset Package
Zoom Outlook Plugin Removal Package
WebEx Tools Removal Package

https://office-reset.com/
リセットツールはプラグインを削除はしてくれるが、再インストールはしないので

ダウンロード - movetotrashmsjunk.dmg


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.6"
use framework "Foundation"
use scripting additions


property refMe : a reference to current application
set appFileManager to refMe's NSFileManager's defaultManager()

set listBundleID to {"com.microsoft.Powerpoint", "com.microsoft.Word", "com.microsoft.Excel"} as list


################################
#### Cachesリセット
set strBaseDirPath to "~/Library/Caches"
set ocidBaseDirPathStr to refMe's NSString's stringWithString:(strBaseDirPath)
set ocidBaseDirPath to ocidBaseDirPathStr's stringByStandardizingPath()
repeat with itemBundleID in listBundleID
  set strBundleID to itemBundleID as text
  set ocidGoToTrashDirPath to (ocidBaseDirPath's stringByAppendingPathComponent:(strBundleID))
  set boolDone to doMoveToTrash(ocidGoToTrashDirPath)
  log boolDone as boolean
end repeat
################################
#### plistリセット
set strBaseDirPath to "~/Library/Preferences"
set ocidBaseDirPathStr to refMe's NSString's stringWithString:(strBaseDirPath)
set ocidBaseDirPath to ocidBaseDirPathStr's stringByStandardizingPath()
repeat with itemBundleID in listBundleID
  set strBundleID to itemBundleID as text
  set ocidBaseFilePath to (ocidBaseDirPath's stringByAppendingPathComponent:(strBundleID))
  set ocidGoToTrashDirPath to (ocidBaseFilePath's stringByAppendingPathExtension:("plist"))
  set boolDone to doMoveToTrash(ocidGoToTrashDirPath)
  log boolDone as boolean
end repeat
################################
#### Containersリセット
set strBaseDirPath to "~/Library/Containers"
set ocidBaseDirPathStr to refMe's NSString's stringWithString:(strBaseDirPath)
set ocidBaseDirPath to ocidBaseDirPathStr's stringByStandardizingPath()
repeat with itemBundleID in listBundleID
  set strBundleID to itemBundleID as text
  set ocidGoToTrashDirPath to (ocidBaseDirPath's stringByAppendingPathComponent:(strBundleID))
  set boolDone to doMoveToTrash(ocidGoToTrashDirPath)
  log boolDone as boolean
end repeat
################################
#### Application Scriptsリセット
set strBaseDirPath to "~/Library/Application Scripts"
set ocidBaseDirPathStr to refMe's NSString's stringWithString:(strBaseDirPath)
set ocidBaseDirPath to ocidBaseDirPathStr's stringByStandardizingPath()
repeat with itemBundleID in listBundleID
  set strBundleID to itemBundleID as text
  set ocidGoToTrashDirPath to (ocidBaseDirPath's stringByAppendingPathComponent:(strBundleID))
  set boolDone to doMoveToTrash(ocidGoToTrashDirPath)
  log boolDone as boolean
end repeat

################################
#### temporaryDirectory T リセット
set ocidTemporaryDirPathURL to appFileManager's temporaryDirectory
repeat with itemBundleID in listBundleID
  set strBundleID to itemBundleID as text
  set ocidGoToTrashDirPathURL to (ocidTemporaryDirPathURL's URLByAppendingPathComponent:(strBundleID))
  set boolDone to doMoveToTrash(ocidGoToTrashDirPathURL)
  log boolDone as boolean
end repeat

################################
#### temporaryDirectory C リセット
set ocidTemporaryDirPathURL to appFileManager's temporaryDirectory
set ocidContainerDirPathURL to ocidTemporaryDirPathURL's URLByDeletingLastPathComponent()
set ocidCPathURL to ocidContainerDirPathURL's URLByAppendingPathComponent:"C"
repeat with itemBundleID in listBundleID
  set strBundleID to itemBundleID as text
  set ocidGoToTrashDirPathURL to (ocidCPathURL's URLByAppendingPathComponent:(strBundleID))
  set boolDone to doMoveToTrash(ocidGoToTrashDirPathURL)
  log boolDone as boolean
end repeat


################################
###Startup.localized クリーニング
set strFilePath to "~/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Startup.localized/Word/~$nkCreation.dotm"
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidFilePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:ocidFilePath isDirectory:false
set boolDone to doMoveToTrash(ocidFilePathURL)

set strFilePath to "~/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Startup.localized/Excel/~$SaveAsAdobePDF.xlam"
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidFilePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:ocidFilePath isDirectory:false
set boolDone to doMoveToTrash(ocidFilePathURL)


set strFilePath to "~/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Startup.localized/Powerpoint/~$SaveAsAdobePDF.ppam"
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidFilePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:ocidFilePath isDirectory:false
set boolDone to doMoveToTrash(ocidFilePathURL)

################################
###Startup.localized クリーニング
set strFilePath to "~/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Startup.localized/Word/nkCreation.dotm"
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidFilePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:ocidFilePath isDirectory:false
set boolDone to doMoveToTrash(ocidFilePathURL)

set strFilePath to "~/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Startup.localized/Excel/SaveAsAdobePDF.xlam"
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidFilePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:ocidFilePath isDirectory:false
set boolDone to doMoveToTrash(ocidFilePathURL)


set strFilePath to "~/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Startup.localized/Powerpoint/SaveAsAdobePDF.ppam"
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidFilePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:ocidFilePath isDirectory:false
set boolDone to doMoveToTrash(ocidFilePathURL)



################################
####Add-Ins.localized クリーニング
set strFilePath to "~/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Add-Ins.localized/Word/~$nkCreation.dotm"
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidFilePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:ocidFilePath isDirectory:false
set boolDone to doMoveToTrash(ocidFilePathURL)

set strFilePath to "~/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Add-Ins.localized/Excel/~$SaveAsAdobePDF.xlam"
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidFilePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:ocidFilePath isDirectory:false
set boolDone to doMoveToTrash(ocidFilePathURL)

set strFilePath to "~/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Add-Ins.localized/Powerpoint/~$SaveAsAdobePDF.ppam"
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidFilePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:ocidFilePath isDirectory:false
set boolDone to doMoveToTrash(ocidFilePathURL)
################################

set strFilePath to "~/Library/Group Containers/UBF8T346G9.Office/mip_policy"
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set boolDone to doMoveToTrash(ocidFilePath)
set strFilePath to "~/Library/Group Containers/UBF8T346G9.Office/FontCache"
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set boolDone to doMoveToTrash(ocidFilePath)
set strFilePath to "~/Library/Group Containers/UBF8T346G9.Office/ComRPC32"
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set boolDone to doMoveToTrash(ocidFilePath)
set strFilePath to "~/Library/Group Containers/UBF8T346G9.Office/TemporaryItems"
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set boolDone to doMoveToTrash(ocidFilePath)
set strFilePath to "~/Library/Group Containers/UBF8T346G9.Office/MicrosoftRegistrationDB.reg"
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set boolDone to doMoveToTrash(ocidFilePath)
set strFilePath to "~/Library/Group Containers/UBF8T346G9.Office/Microsoft Office ACL [English]"
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set boolDone to doMoveToTrash(ocidFilePath)

####新しいファイルをコピーする

set ocidUserShotName to refMe's NSUserName()
set strUserName to ocidUserShotName as text

set strDtomFilePath to "/Library/Application Support/Adobe/MACPDFM/DC/linkCreation.dotm"
set strPpamFilePath to "/Library/Application Support/Adobe/MACPDFM/DC/SaveAsAdobePDF.ppam"
set strXlamFilePath to "/Library/Application Support/Adobe/MACPDFM/DC/SaveAsAdobePDF.xlam"

set strDistDtomFilePath to "/Users/" & strUserName & "/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Startup.localized/Word/linkCreation.dotm"
set strDistPpamFilePath to "/Users/" & strUserName & "/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Startup.localized/Powerpoint/SaveAsAdobePDF.ppam"
set strDistXlamFilePath to "/Users/" & strUserName & "/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Startup.localized/Excel/SaveAsAdobePDF.xlam"


set strCommandText to ("/usr/bin/ditto \"" & strDtomFilePath & "\" \"" & strDistDtomFilePath & "\"") as text
do shell script strCommandText
set strCommandText to ("/usr/bin/ditto \"" & strPpamFilePath & "\" \"" & strDistPpamFilePath & "\"") as text
do shell script strCommandText
set strCommandText to ("/usr/bin/ditto \"" & strXlamFilePath & "\" \"" & strDistXlamFilePath & "\"") as text
do shell script strCommandText

set strCommandText to ("/bin/chmod 755 \"" & strDistDtomFilePath & "\"") as text
do shell script strCommandText
set strCommandText to ("/bin/chmod 755 \"" & strDistPpamFilePath & "\"") as text
do shell script strCommandText
set strCommandText to ("/bin/chmod 755 \"" & strDistXlamFilePath & "\"") as text
do shell script strCommandText



################################
####User Content.localizedを開く
set strDirFilePath to "~/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Startup.localized"
set ocidFilePathStr to refMe's NSString's stringWithString:(strDirFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidFilePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:ocidFilePath isDirectory:true
set appShardWorkspace to refMe's NSWorkspace's sharedWorkspace()
appShardWorkspace's openURL:ocidFilePathURL

################################
####ゴミ箱に入れるサブ
to doMoveToTrash(argFilePath)
  ###ファイルマネジャー初期化
  set appFileManager to refMe's NSFileManager's defaultManager()
  #########################################
  ###渡された値のClassを調べてとりあえずNSURLにする
  set refClass to class of argFilePath
  if refClass is list then
return "エラーリストは処理しません"
  else if refClass is text then
    log "テキストパスです"
    set ocidArgFilePathStr to (refMe's NSString's stringWithString:argFilePath)
    set ocidArgFilePath to ocidArgFilePathStr's stringByStandardizingPath
    set ocidArgFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:ocidArgFilePath)
  else if refClass is alias then
    log "エイリアスパスです"
    set strArgFilePath to (POSIX path of argFilePath) as text
    set ocidArgFilePathStr to (refMe's NSString's stringWithString:strArgFilePath)
    set ocidArgFilePath to ocidArgFilePathStr's stringByStandardizingPath
    set ocidArgFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:ocidArgFilePath)
  else
    set refClass to (className() of argFilePath) as text
    if refClass contains "NSPathStore2" then
      log "NSPathStore2です"
      set ocidArgFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:argFilePath)
    else if refClass contains "NSCFString" then
      log "NSCFStringです"
      set ocidArgFilePath to argFilePath's stringByStandardizingPath
      set ocidArgFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:ocidArgFilePath)
    else if refClass contains "NSURL" then
      set ocidArgFilePathURL to argFilePath
      log "NSURLです"
    end if
  end if
  #########################################
  ###
  -->false
  set ocidFalse to (refMe's NSNumber's numberWithBool:false)'s boolValue
  -->true
  set ocidTrue to (refMe's NSNumber's numberWithBool:true)'s boolValue
  #########################################
  ###NSURLがエイリアス実在するか?
  set ocidArgFilePath to ocidArgFilePathURL's |path|()
  set boolFileAlias to appFileManager's fileExistsAtPath:(ocidArgFilePath)
  log ocidArgFilePath as text
  ###パス先が実在しないなら処理はここまで
  if boolFileAlias = false then
    log "処理中止"
return false
  end if
  #########################################
  ###NSURLがディレクトリなのか?ファイルなのか?
  set listBoolDir to ocidArgFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLIsDirectoryKey) |error|:(reference)
  if (item 2 of listBoolDir) = ocidTrue then
    #########################################
    log "ディレクトリです"
    ##内包リスト
    set listResult to appFileManager's contentsOfDirectoryAtURL:ocidArgFilePathURL includingPropertiesForKeys:{refMe's NSURLPathKey} options:0 |error|:(reference)
    ###結果
    set ocidContentsPathURLArray to item 1 of listResult
    ###リストの数だけ繰り返し
    repeat with itemContentsPathURL in ocidContentsPathURLArray
      ###ゴミ箱に入れる
      set listResult to (appFileManager's trashItemAtURL:itemContentsPathURL resultingItemURL:(missing value) |error|:(reference))
    end repeat
  else
    #########################################
    log "ファイルです"
    ###念のためFilderでも調べる
    tell application "Finder"
      set aliasArgFilePath to ocidArgFilePathURL as alias
      set strPathKind to (kind of aliasArgFilePath) as text
    end tell
    ###/tmpのような特殊フォルダの場合は処理しない
    if strPathKind is "フォルダ" then
return "特殊ディレクトリかシンボリックリンクなので処理しません"
    else
      ###ファイルをゴミ箱に入れる
      set listResult to (appFileManager's trashItemAtURL:ocidArgFilePathURL resultingItemURL:(missing value) |error|:(reference))
    end if
  end if
return true
end doMoveToTrash

|

[admin] swiftDialogアップデート(pkgインストール)

インストールポイントは
/Library/Application Support/Dialog
/usr/local/bin/dialog の2点


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
(*
スクリプトエディタで実行する場合は指紋認証応答があります(要管理者権限)
コマンドライン実行する場合は 要 sudoです
com.cocolog-nifty.quicktimer.icefloe
*)
#
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application
property refNSNotFound : a reference to 9.22337203685477E+18 + 5807


set strURL to "https://api.github.com/repos/bartreardon/swiftDialog/releases/latest"


set coidBaseURLStr to refMe's NSString's stringWithString:(strURL)
set ocidBaseURL to refMe's NSURL's URLWithString:(coidBaseURLStr)

################################################
###### URLRequest部分
################################################
set ocidURLRequest to refMe's NSMutableURLRequest's alloc()'s init()
ocidURLRequest's setHTTPMethod:"GET"
ocidURLRequest's setURL:(ocidBaseURL)
ocidURLRequest's addValue:"application/json" forHTTPHeaderField:"Content-Type"
###ポストするデータは空
ocidURLRequest's setHTTPBody:(missing value)

################################################
###### データ取得
################################################
set ocidServerResponse to refMe's NSURLConnection's sendSynchronousRequest:(ocidURLRequest) returningResponse:(missing value) |error|:(reference)
###取得JSONデータ
set ocidJsonResponse to (item 1 of ocidServerResponse)
####取得データをJSONで確定
set ocidJsonData to refMe's NSJSONSerialization's JSONObjectWithData:(ocidJsonResponse) options:(refMe's NSJSONReadingMutableContainers) |error|:(reference)
####レコードに格納
set ocidJsonDict to (refMe's NSDictionary's alloc()'s initWithDictionary:(item 1 of ocidJsonData))

################################################
###### URLとPKG名を抽出
################################################
set ocidAssets to (ocidJsonDict's valueForKey:"assets")
set ocidPkgURLArray to (ocidAssets's valueForKey:"browser_download_url")
set ocidPkgURLStr to ocidPkgURLArray's firstObject()
set ocidPkgURL to refMe's NSURL's URLWithString:(ocidPkgURLStr)
log ocidPkgURL's absoluteString() as text
set ocidPkgFileName to ocidPkgURL's lastPathComponent()
################################################
###### ダウンロード フォルダを作っておく
################################################
###NSFileManager初期化
set appFileManager to refMe's NSFileManager's defaultManager()
###フォルダの名前は日付
set ocidDate to refMe's NSDate's |date|()
set ocidNSDateFormatter to refMe's NSDateFormatter's alloc()'s init()
ocidNSDateFormatter's setDateFormat:"yyyyMMddhhmmss"
set ocidDateAndTime to ocidNSDateFormatter's stringFromDate:(ocidDate)
#####保存先のファイルパス
set strTempPath to ("/private/tmp/" & (ocidDateAndTime as text) & "") as text
#####NSStringファイルパス
set ocidDirPath to (refMe's NSString's stringWithString:strTempPath)
#####FileManager
set listBoolMakeDir to appFileManager's createDirectoryAtPath:(ocidDirPath) withIntermediateDirectories:true attributes:(missing value) |error|:(reference)
log class of (item 1 of listBoolMakeDir) as text
set boolMakeDir to (item 1 of listBoolMakeDir) as boolean
log boolMakeDir
if boolMakeDir is false then
  error "フォルダ作成に失敗しました" number -2753 from "フォルダ作成に失敗しました"
return
end if

################################################
###### ダウンロード
################################################
###ファイルをダウンロード
set listDownLoadData to (refMe's NSData's dataWithContentsOfURL:(ocidPkgURL) options:0 |error|:(reference))
set ocidDownLoadData to (item 1 of listDownLoadData)
if ocidDownLoadData is (missing value) then
  error "ダウンロードに失敗しました" number -2753 from "ダウンロードに失敗しました"
return "ダウンロードに失敗しました"
end if
################################################
###### 保存
################################################
set ocidTmpDirPath to ocidDirPath's stringByStandardizingPath()
set ocidTmpDirPathURL to refMe's NSURL's alloc()'s initFileURLWithPath:(ocidTmpDirPath) isDirectory:true
set ocidSaveFilePathURL to ocidTmpDirPathURL's URLByAppendingPathComponent:(ocidPkgFileName) isDirectory:false
set strSaveFilePath to (ocidSaveFilePathURL's |path|()) as text

set boolSaveFileDone to (ocidDownLoadData's writeToURL:(ocidSaveFilePathURL) atomically:true)

################################################
###### インストール 要管理者権限
################################################
set strCommandText to ("/usr/bin/sudo /usr/sbin/installer -pkg \"" & strSaveFilePath & "\" -target / -dumplog -allowUntrusted -verboseR -lang ja") as text
## set strUserName to "admin" as text
## set strAdminPassWord to "" as text
## do shell script strCommandText user name theUserName password theAdminPassWord with administrator privileges
do shell script strCommandText with administrator privileges




|

その他のカテゴリー

Acrobat Acrobat Annotation Acrobat Dialog Acrobat Form Acrobat JS Acrobat Open Acrobat Plugin Acrobat python Acrobat Reader Acrobat Sequ Acrobat Stamps Admin Admin Account Admin Apachectl Admin configCode Admin Device Management Admin LaunchServices Admin Locationd Admin loginitem Admin Maintenance Admin Permission Admin Pkg Admin Power Management Admin Printer Admin SetUp Admin SMB Admin System Information Admin Tools Admin Users Admin Volumes Adobe Apple AppleScript AppleScript Guide AppleScript Accessibility AppleScript AppKit AppleScript Applications AppleScript AppStore AppleScript Archive AppleScript Attributes AppleScript Automator AppleScript AVAsset AppleScript AVconvert AppleScript AVFoundation AppleScript AVURLAsset AppleScript BackUp AppleScript Barcode AppleScript Bash AppleScript Basic AppleScript Basic Path AppleScript Bluetooth AppleScript BOX AppleScript Browser AppleScript Calendar AppleScript CD/DVD AppleScript Choose AppleScript Chrome AppleScript CIImage AppleScript CloudStorage AppleScript Color AppleScript com.apple.LaunchServices.OpenWith AppleScript Console AppleScript Contacts AppleScript CotEditor AppleScript CURL AppleScript current application AppleScript Date&Time AppleScript delimiters AppleScript Desktop AppleScript Device AppleScript Disk AppleScript do shell script AppleScript Dock AppleScript DropBox AppleScript eMail AppleScript Encode Decode AppleScript Error AppleScript EXIFData AppleScript ffmpeg AppleScript File AppleScript Finder AppleScript Firefox AppleScript Folder AppleScript Fonts AppleScript GIF AppleScript HTML AppleScript Icon AppleScript Illustrator AppleScript Image Events AppleScript Image2PDF AppleScript ImageOptim Applescript iWork AppleScript Javascript AppleScript Jedit AppleScript Json AppleScript Label AppleScript List AppleScript locationd AppleScript LRC AppleScript LSSharedFileList AppleScript m3u8 AppleScript MakePDF AppleScript Map AppleScript Math AppleScript Microsoft AppleScript Microsoft Edge AppleScript Microsoft Excel AppleScript Mobileconfig AppleScript Mouse AppleScript Movie AppleScript Music AppleScript NetWork AppleScript Notes AppleScript NSArray AppleScript NSBitmapImageRep AppleScript NSBundle AppleScript NSCFBoolean AppleScript NSCharacterSet AppleScript NSColor AppleScript NSColorList AppleScript NSData AppleScript NSDictionary AppleScript NSError AppleScript NSEvent AppleScript NSFileAttributes AppleScript NSFileManager AppleScript NSFont AppleScript NSFontManager AppleScript NSImage AppleScript NSIndex AppleScript NSKeyedArchiver AppleScript NSKeyedUnarchiver AppleScript NSLocale AppleScript NSMutableArray AppleScript NSMutableDictionary AppleScript NSMutableString AppleScript NSNotFound AppleScript NSNumber AppleScript NSOpenPanel AppleScript NSPasteboard AppleScript NSPDFImageRep AppleScript NSpoint AppleScript NSPredicate AppleScript NSRange AppleScript NSRegularExpression AppleScript NSRunningApplication AppleScript NSScreen AppleScript NSSize AppleScript NSString AppleScript NSStringCompareOptions AppleScript NSTask AppleScript NSTimeZone AppleScript NSURL AppleScript NSURL File AppleScript NSURLBookmark AppleScript NSURLComponents AppleScript NSURLResourceKey AppleScript NSUserDefaults AppleScript NSUUID AppleScript NSView AppleScript NSWorkspace AppleScript Numbers AppleScript OAuth AppleScript ObjC AppleScript OneDrive AppleScript Osax AppleScript PDF AppleScript PDFAnnotationWidget AppleScript PDFContext AppleScript PDFDisplayBox AppleScript PDFDocumentPermissions AppleScript PDFKit AppleScript PDFnUP AppleScript PDFOutline AppleScript Photos AppleScript Photoshop AppleScript Plist System Events AppleScript PostScript AppleScript prefPane AppleScript Preview AppleScript Python AppleScript QR AppleScript QR Decode AppleScript QuickLook AppleScript QuickTime AppleScript record AppleScript Regular Expression AppleScript Reminders AppleScript ReName AppleScript Repeat AppleScript RTF AppleScript Safari AppleScript SaveFile AppleScript ScreenCapture AppleScript ScreenSaver AppleScript Script Editor AppleScript Script Menu AppleScript Shortcuts AppleScript Shortcuts Events AppleScript Sort AppleScript Sound AppleScript Spotlight AppleScript SRT AppleScript StandardAdditions AppleScript stringByApplyingTransform AppleScript System Events AppleScript System Settings AppleScript TemporaryItems AppleScript Terminal AppleScript Text AppleScript Text CSV AppleScript Text TSV AppleScript TextEdit AppleScript Translate AppleScript Trash AppleScript Twitter AppleScript UI AppleScript Unit Conversion AppleScript UTType AppleScript valueForKeyPath AppleScript Video AppleScript VisionKit AppleScript Visual Studio Code AppleScript webarchive AppleScript webp AppleScript Wifi AppleScript XML AppleScript XML EPUB AppleScript XML OPML AppleScript XML Plist AppleScript XML RSS AppleScript XML SVG AppleScript XML TTML AppleScript XML webloc AppleScript YouTube AppleScript Zero Suppress Applications Barcode OnLine Tools CityCode Design iPhone List Logs lsappinfo Memo Music perl PlistBuddy pluginkit postalcode ReadMe SF Symbols character id SF Symbols Entity sips Skype Slack sqlite TCC Tools Typography Video Wacom zoom