Admin System Information

system infoの内容をテキスト保存する


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

#!/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 scripting additions

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


###保存先 ディレクトリ
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDocumentDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidDocumentDirPathURL to ocidURLsArray's firstObject()
set ocidSaveDirPathURL to ocidDocumentDirPathURL's URLByAppendingPathComponent:("Apple/SystemInfo") isDirectory:true
set ocidAttrDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
# 777-->511 755-->493 700-->448 766-->502
ocidAttrDict's setValue:(448) forKey:(refMe's NSFilePosixPermissions)
set listBoolMakeDir to appFileManager's createDirectoryAtURL:(ocidSaveDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error|:(reference)

########################
#system info
set ocidSaveFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:("SystemInfo.rtf") isDirectory:true
set strSaveFilePath to ocidSaveFilePathURL's |path| as text
set aliasSaveFilePath to (ocidSaveFilePathURL's absoluteURL()) as «class furl»
set recordSysInfo to (run script "return system info") as record

set recordSysInfoR to {|AppleScript version|:AppleScript version of (recordSysInfo), |AppleScript Studio version|:AppleScript Studio version of (recordSysInfo), |system version|:system version of (recordSysInfo), |short user name|:short user name of (recordSysInfo), |long user name|:long user name of (recordSysInfo), |user ID|:user ID of (recordSysInfo), |user locale|:user locale of (recordSysInfo), |home directory|:home directory of (recordSysInfo), |boot volume|:boot volume of (recordSysInfo), |computer name|:computer name of (recordSysInfo), |host name|:host name of (recordSysInfo), |IPv4 address|:IPv4 address of (recordSysInfo), |primary Ethernet address|:primary Ethernet address of (recordSysInfo), |CPU type|:CPU type of (recordSysInfo), |CPU speed|:CPU speed of (recordSysInfo), |physical memory|:physical memory of (recordSysInfo)} as record


set ocidSystemInfoDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
ocidSystemInfoDict's setDictionary:(recordSysInfoR)

set ocidAllKeys to ocidSystemInfoDict's allKeys()

set strResponse to "" as text
repeat with itemKeys in ocidAllKeys
  set strKeys to itemKeys as text
  set strValue to (ocidSystemInfoDict's valueForKey:(itemKeys)) as text
  set strResponse to (strKeys & ":" & strValue & "\r" & strResponse) as text
end repeat


tell application "TextEdit"
activate
properties
  set objNewDoc to (make new document with properties {name:"SystemInfo", text:strResponse, path:strSaveFilePath})
  tell objNewDoc
    tell its text
properties of attribute run of every paragraph
      set its size to 20
      set its font to "Osaka-Mono"
      set its color of every paragraph to {0, 0, 0}
properties of attribute run of every paragraph
    end tell
  end tell
save objNewDoc in aliasSaveFilePath
end tell

########################
#ifconfig.me.rtf
set ocidSaveFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:("ifconfig.me.rtf") isDirectory:true
set strSaveFilePath to ocidSaveFilePathURL's |path| as text
set aliasSaveFilePath to (ocidSaveFilePathURL's absoluteURL()) as «class furl»
set strCommandText to "/bin/echo $(/usr/bin/curl -s ifconfig.me)" as text
set strResponse to (do shell script strCommandText) as text

set strResponse to (strCommandText & "\r" & strResponse) as text
tell application "TextEdit"
activate
properties
  set objNewDoc to (make new document with properties {name:"ifconfig.me", text:strResponse, path:strSaveFilePath})
  tell objNewDoc
    tell its text
properties of attribute run of every paragraph
      set its size to 20
      set its font to "Osaka-Mono"
      set its color of every paragraph to {0, 0, 0}
properties of attribute run of every paragraph
    end tell
  end tell
save objNewDoc in aliasSaveFilePath
end tell


########################
######networksetup
set strResponse to "" as text
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 strComResponse to (do shell script strCommandText) as text
  set strResponse to strServiceName & "\r" & strComResponse & "\r-------\r" & strResponse as text
end repeat



set ocidSaveFilePathURL to (ocidSaveDirPathURL's URLByAppendingPathComponent:("networksetup.rtf") isDirectory:true)
set strSaveFilePath to ocidSaveFilePathURL's |path| as text
set aliasSaveFilePath to (ocidSaveFilePathURL's absoluteURL()) as «class furl»
tell application "TextEdit"
activate
properties
  set objNewDoc to (make new document with properties {name:"networksetup", text:strResponse, path:strSaveFilePath})
  tell objNewDoc
    tell its text
properties of attribute run of every paragraph
      set its size to 20
      set its font to "Osaka-Mono"
      set its color of every paragraph to {0, 0, 0}
properties of attribute run of every paragraph
    end tell
  end tell
save objNewDoc in aliasSaveFilePath
end tell




########################
(* 廃止
######airport
set ocidSaveFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:("airport-i.rtf") isDirectory:true
set strSaveFilePath to ocidSaveFilePathURL's |path| as text
set aliasSaveFilePath to (ocidSaveFilePathURL's absoluteURL()) as «class furl»
set strCommandText to "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I" as text
set strResponse to (do shell script strCommandText) as text
tell application "TextEdit"
activate
properties
set objNewDoc to (make new document with properties {name:"airport-I", text:strResponse, path:strSaveFilePath})
tell objNewDoc
tell its text
properties of attribute run of every paragraph
set its size to 20
set its font to "Osaka-Mono"
set its color of every paragraph to {0, 0, 0}
properties of attribute run of every paragraph
end tell
end tell
save objNewDoc in aliasSaveFilePath
end tell
*)
########################
######getpacket
set ocidSaveFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:("getpacket.rtf") isDirectory:true
set strSaveFilePath to ocidSaveFilePathURL's |path| as text
set aliasSaveFilePath to (ocidSaveFilePathURL's absoluteURL()) as «class furl»
set strCommandText to "/usr/sbin/ipconfig getpacket en0" as text
set strResponse to (do shell script strCommandText) as text
tell application "TextEdit"
activate
properties
  set objNewDoc to (make new document with properties {name:"getpacket", text:strResponse, path:strSaveFilePath})
  tell objNewDoc
    tell its text
properties of attribute run of every paragraph
      set its size to 20
      set its font to "Osaka-Mono"
      set its color of every paragraph to {0, 0, 0}
properties of attribute run of every paragraph
    end tell
  end tell
  
save objNewDoc in aliasSaveFilePath
end tell

########################
######getpacket
set ocidSaveFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:("ifconfigA.rtf") isDirectory:true
set strSaveFilePath to ocidSaveFilePathURL's |path| as text
set aliasSaveFilePath to (ocidSaveFilePathURL's absoluteURL()) as «class furl»
set strCommandText to "/sbin/ifconfig -a" as text
set strResponse to (do shell script strCommandText) as text
tell application "TextEdit"
activate
properties
  set objNewDoc to (make new document with properties {name:"ifconfig", text:strResponse, path:strSaveFilePath})
  tell objNewDoc
    tell its text
properties of attribute run of every paragraph
      set its size to 20
      set its font to "Osaka-Mono"
      set its color of every paragraph to {0, 0, 0}
properties of attribute run of every paragraph
    end tell
  end tell
  
save objNewDoc in aliasSaveFilePath
end tell

########################
#arp
set ocidSaveFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:("arp.rtf") isDirectory:true
set strSaveFilePath to ocidSaveFilePathURL's |path| as text
set aliasSaveFilePath to (ocidSaveFilePathURL's absoluteURL()) as «class furl»
set strCommandText to "/usr/sbin/arp -a" as text
set strResponse to (do shell script strCommandText) as text
tell application "TextEdit"
activate
properties
  set objNewDoc to (make new document with properties {name:"arp", text:strResponse, path:strSaveFilePath})
  tell objNewDoc
    tell its text
properties of attribute run of every paragraph
      set its size to 20
      set its font to "Osaka-Mono"
      set its color of every paragraph to {0, 0, 0}
properties of attribute run of every paragraph
    end tell
  end tell
  
save objNewDoc in aliasSaveFilePath
end tell


|

SystemStatsを取得してHTMLで表示


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

#!/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 strCommandText to ("/usr/sbin/systemstats --concise-dashboard tsv") as text

set strH3Text to ("SystemStats一覧") as text
set strCaption to ("SystemStats") as text
set strArticleH3 to ("SystemStatsコマンドで収集したデータ") as text


#書類フォルダ
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDocumentDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidDocumentDirPathURL to ocidURLsArray's firstObject()
set ocidSaveDirPathURL to ocidDocumentDirPathURL's URLByAppendingPathComponent:("Apple/SystemStats")
#フォルダを作る
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidAttrDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
# 777-->511 755-->493 700-->448 766-->502
ocidAttrDict's setValue:(448) forKey:(refMe's NSFilePosixPermissions)
set listBoolMakeDir to appFileManager's createDirectoryAtURL:(ocidSaveDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error|:(reference)
#
set strDate to doGetDateNo("yyyyMMdd")
set ocidBasePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:(strDate) isDirectory:(false)
set ocidSaveFilePathURL to ocidBasePathURL's URLByAppendingPathExtension:("tsv")
set ocidHTMLFilePathURL to ocidBasePathURL's URLByAppendingPathExtension:("html")
#
set strResponse to (do shell script strCommandText) as text
#
set ocidReadString to refMe's NSString's stringWithString:(strResponse)
set ocidSaveString to doChgColRowTSV(ocidReadString)
##
set listDone to ocidSaveString's writeToURL:(ocidSaveFilePathURL) atomically:(true) encoding:(refMe's NSUTF8StringEncoding) |error|:(reference)

### ファイルのテキストを読み込み
set listResponse to (refMe's NSString's alloc()'s initWithContentsOfURL:(ocidSaveFilePathURL) encoding:(refMe's NSUTF8StringEncoding) |error|:(reference))
set ocidReadString to (item 1 of listResponse)
#可変にして
set ocidLineString to (refMe's NSMutableString's alloc()'s initWithCapacity:(0))
(ocidLineString's setString:(ocidReadString))
#改行をUNIXに強制
set ocidLineStringLF to (ocidLineString's stringByReplacingOccurrencesOfString:("\r\n") withString:("\n"))
set ocidLineString to (ocidLineStringLF's stringByReplacingOccurrencesOfString:("\r") withString:("\n"))
#改行毎でリストにする
set ocidCharSet to (refMe's NSCharacterSet's newlineCharacterSet)
set ocidLineArray to (ocidLineString's componentsSeparatedByCharactersInSet:(ocidCharSet))
#最初の1行目だけ別で取得しておく
set ocidFirstObjectString to ocidLineArray's firstObject()
set ocidFirstLineArray to ocidFirstObjectString's componentsSeparatedByString:("\t")

###データをHTMLに整形
########################################
#headerに渡すエレメント
set ocidSetHeaderElement to (refMe's NSXMLElement's elementWithName:("div"))
set ocidH3Element to refMe's NSXMLElement's elementWithName:("h3")
(ocidH3Element's setStringValue:(strH3Text))
(ocidSetHeaderElement's addChild:(ocidH3Element))

########################################
#footerに渡すエレメント
set ocidSetFooterElement to (refMe's NSXMLElement's elementWithName:("div"))
set ocidAElement to refMe's NSXMLElement's elementWithName:("a")
set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("href") stringValue:("https://quicktimer.cocolog-nifty.com/"))
(ocidAElement's addAttribute:(ocidAddNode))
set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("target") stringValue:("_blank"))
(ocidAElement's addAttribute:(ocidAddNode))
set strContents to ("AppleScriptで生成しました") as text
(ocidAElement's setStringValue:(strContents))
(ocidSetFooterElement's addChild:(ocidAElement))

########################################
#articleに渡すエレメント
set ocidSetArticleElement to (refMe's NSXMLElement's elementWithName:("div"))
set ocidH3Element to (refMe's NSXMLElement's elementWithName:("h3"))
set strSetValue to (strArticleH3) as text
(ocidH3Element's setStringValue:(strSetValue))
(ocidSetArticleElement's addChild:(ocidH3Element))

#########################
#テーブル部生成開始
set ocidTableElement to refMe's NSXMLElement's elementWithName:("table")
#【caption】
set ocidCaptionElement to refMe's NSXMLElement's elementWithName:("caption")
ocidCaptionElement's setStringValue:(strCaption)
ocidTableElement's addChild:(ocidCaptionElement)
#【colgroup】
set ocidColgroupElement to refMe's NSXMLElement's elementWithName:("colgroup")
#タイトル部の数だけ繰り返し
#項番部を追加する
set strFirstCol to ("LineNo") as text
ocidFirstLineArray's insertObject:(strFirstCol) atIndex:(0)
repeat with itemColName in ocidFirstLineArray
  #【col】col生成
  set ocidAddElement to (refMe's NSXMLElement's elementWithName:("col"))
  set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("title") stringValue:(itemColName))
(ocidAddElement's addAttribute:(ocidAddNode))
(ocidColgroupElement's addChild:(ocidAddElement))
end repeat
#テーブルエレメントに追加
ocidTableElement's addChild:(ocidColgroupElement)
#【thead】
set ocidTheadElement to refMe's NSXMLElement's elementWithName:("thead")
#TR
set ocidTrElement to refMe's NSXMLElement's elementWithName:("tr")
#タイトル部の数だけ繰り返し
repeat with itemColName in ocidFirstLineArray
  if (itemColName as text) is "LineNo" then
    #ここはTDではなくてTHを利用
    set ocidAddElement to (refMe's NSXMLElement's elementWithName:("th"))
    ####項番処理
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("title") stringValue:(itemColName))
(ocidAddElement's addAttribute:(ocidAddNode))
    #
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("id") stringValue:(itemColName))
(ocidAddElement's addAttribute:(ocidAddNode))
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("scope") stringValue:("col"))
(ocidAddElement's addAttribute:(ocidAddNode))
    #値を入れる
(ocidAddElement's setStringValue:("\"))
    #TH→TRにセット
(ocidTrElement's addChild:(ocidAddElement))
  else
    #ここはTDではなくてTHを利用
    set ocidAddElement to (refMe's NSXMLElement's elementWithName:("th"))
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("title") stringValue:(itemColName))
(ocidAddElement's addAttribute:(ocidAddNode))
    #
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("id") stringValue:(itemColName))
(ocidAddElement's addAttribute:(ocidAddNode))
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("scope") stringValue:("col"))
(ocidAddElement's addAttribute:(ocidAddNode))
    #値を入れる
(ocidAddElement's setStringValue:(itemColName))
    #TH→TRにセット
(ocidTrElement's addChild:(ocidAddElement))
  end if
end repeat
#TRをTHEADにセット
ocidTheadElement's addChild:(ocidTrElement)
#THEADをテーブルにセット
ocidTableElement's addChild:(ocidTheadElement)
########################################
#【tbody】
set ocidTbodyElement to refMe's NSXMLElement's elementWithName:("tbody")
###【3-4】:item
set numCntContents to (count of ocidLineArray) - 1 as integer
repeat with itemIntNo from 1 to numCntContents by 1
  set ocidLineItem to (ocidLineArray's objectAtIndex:(itemIntNo))
  #空行で終わり(TSVが改行で終わるタイプ)
  if (ocidLineItem as text) is "" then
    exit repeat
  end if
  #
  set ocidItemLineArray to (ocidLineItem's componentsSeparatedByString:("\t"))
  set numCntItemLineArray to (count of ocidItemLineArray) as integer
  ##############
  #TRの開始
  set ocidTrElement to (refMe's NSXMLElement's elementWithName:("tr"))
  ####項番処理
  set ocidThElement to (refMe's NSXMLElement's elementWithName:("th"))
  set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("title") stringValue:("項目番号:" & itemIntNo))
(ocidThElement's addAttribute:(ocidAddNode))
  set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("headers") stringValue:("LineNo"))
(ocidThElement's addAttribute:(ocidAddNode))
  set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("scope") stringValue:("col"))
(ocidThElement's addAttribute:(ocidAddNode))
(ocidThElement's setStringValue:(itemIntNo as text))
(ocidTrElement's addChild:(ocidThElement))
  
  repeat with itemLineNo from 0 to (numCntItemLineArray - 1) by 1
    set coidFieldValue to (ocidItemLineArray's objectAtIndex:(itemLineNo))
    if itemLineNo = 0 then
      set ocidThElement to (refMe's NSXMLElement's elementWithName:("th"))
      set strTitle to (ocidFirstLineArray's objectAtIndex:(itemLineNo + 1))
      set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("title") stringValue:(strTitle))
(ocidThElement's addAttribute:(ocidAddNode))
      set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("headers") stringValue:(strTitle))
(ocidThElement's addAttribute:(ocidAddNode))
      set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("scope") stringValue:("col"))
(ocidThElement's addAttribute:(ocidAddNode))
(ocidThElement's setStringValue:(coidFieldValue))
(ocidTrElement's addChild:(ocidThElement))
    else
      set ocidTdElement to (refMe's NSXMLElement's elementWithName:("td"))
      set strTitle to (ocidFirstLineArray's objectAtIndex:(itemLineNo + 1))
      set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("title") stringValue:(strTitle))
(ocidTdElement's addAttribute:(ocidAddNode))
      set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("headers") stringValue:(strTitle))
(ocidTdElement's addAttribute:(ocidAddNode))
(ocidTdElement's setStringValue:(coidFieldValue))
(ocidTrElement's addChild:(ocidTdElement))
    end if
  end repeat
(ocidTbodyElement's addChild:(ocidTrElement))
end repeat
#TBODYをテーブルにセット
ocidTableElement's addChild:(ocidTbodyElement)
#【tfoot】 TRで
set ocidTfootElement to refMe's NSXMLElement's elementWithName:("tfoot")
set ocidTrElement to refMe's NSXMLElement's elementWithName:("tr")
#項目数を取得して
set numCntCol to (count of ocidFirstLineArray) as integer
#colspan指定して1行でセット
set ocidThElement to (refMe's NSXMLElement's elementWithName:("th"))
set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("title") stringValue:("テーブルの終わり"))
(ocidThElement's addAttribute:(ocidAddNode))
set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("colspan") stringValue:(numCntCol as text))
(ocidThElement's addAttribute:(ocidAddNode))
set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("scope") stringValue:("row"))
(ocidThElement's addAttribute:(ocidAddNode))
#
set strContents to ("項目数 : " & (numCntContents - 1)) as text
(ocidThElement's setStringValue:(strContents))
#THをTRにセットして
ocidTrElement's addChild:(ocidThElement)
#TRをTFOOTにセット
ocidTfootElement's addChild:(ocidTrElement)
#TFOOTをテーブルにセット
ocidTableElement's addChild:(ocidTfootElement)
#テーブルをArticleにセット
ocidSetArticleElement's addChild:(ocidTableElement)
##############################
#HTMLにする
##############################
set ocidHTML to doMakeRootElement({ocidSetHeaderElement, ocidSetArticleElement, ocidSetFooterElement})

##############################
#保存
##############################
#####保存
#読み取りやすい表示
set ocidXMLdata to ocidHTML's XMLDataWithOptions:(refMe's NSXMLNodePrettyPrint)
#保存
set listDone to ocidXMLdata's writeToURL:(ocidHTMLFilePathURL) options:(refMe's NSDataWritingAtomic) |error|:(reference)

####ブラウザで開く
set aliasFilePath to (ocidHTMLFilePathURL's absoluteURL()) as alias
tell application "Finder"
open location aliasFilePath
end tell

############################################################
# 基本的なHTMLの構造
(*
doMakeRootElement({argHeaderContents, argArticleContents, argFooterContents})
HTMLのBODY部
header
article
footerにそれぞれAddchildするデータをリストで渡す
戻り値はRootエレメントにセットされた
NSXMLDocumentを戻すので 保存すればOK
*)
############################################################
to doMakeRootElement({argHeaderContents, argArticleContents, argFooterContents})
  #XML初期化
  set ocidXMLDoc to refMe's NSXMLDocument's alloc()'s init()
ocidXMLDoc's setDocumentContentKind:(refMe's NSXMLDocumentHTMLKind)
  # DTD付与
  set ocidDTD to refMe's NSXMLDTD's alloc()'s init()
ocidDTD's setName:("html")
ocidXMLDoc's setDTD:(ocidDTD)
  #
  set ocidRootElement to refMe's NSXMLElement's elementWithName:("html")
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("lang") stringValue:("ja")
ocidRootElement's addAttribute:(ocidAddNode)
  #
  set ocidHeadElement to refMe's NSXMLElement's elementWithName:("head")
  #
  set ocidAddElement to refMe's NSXMLElement's elementWithName:("title")
ocidAddElement's setStringValue:("TSV2HTML")
ocidHeadElement's addChild:(ocidAddElement)
  # http-equiv
  set ocidAddElement to refMe's NSXMLElement's elementWithName:("meta")
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("http-equiv") stringValue:("Content-Type")
ocidAddElement's addAttribute:(ocidAddNode)
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("content") stringValue:("text/html; charset=UTF-8")
ocidAddElement's addAttribute:(ocidAddNode)
ocidHeadElement's addChild:(ocidAddElement)
  #
  set ocidAddElement to refMe's NSXMLElement's elementWithName:("meta")
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("http-equiv") stringValue:("Content-Style-Type")
ocidAddElement's addAttribute:(ocidAddNode)
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("content") stringValue:("text/css")
ocidAddElement's addAttribute:(ocidAddNode)
ocidHeadElement's addChild:(ocidAddElement)
  #
  set ocidAddElement to refMe's NSXMLElement's elementWithName:("meta")
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("http-equiv") stringValue:("Content-Script-Type")
ocidAddElement's addAttribute:(ocidAddNode)
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("content") stringValue:("text/javascript")
ocidAddElement's addAttribute:(ocidAddNode)
ocidHeadElement's addChild:(ocidAddElement)
  #
  set ocidAddElement to refMe's NSXMLElement's elementWithName:("meta")
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("name") stringValue:("viewport")
ocidAddElement's addAttribute:(ocidAddNode)
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("content") stringValue:("width=device-width, initial-scale=1.0")
ocidAddElement's addAttribute:(ocidAddNode)
ocidHeadElement's addChild:(ocidAddElement)
  #
  set ocidAddElement to refMe's NSXMLElement's elementWithName:("style")
ocidAddElement's setStringValue:("body {margin: 10px;background-color: #FFFFFF;}table {border-spacing: 0;caption-side: top;font-family: system-ui;}thead th {border: solid 1px #666666;padding: .5ch 1ch;border-block-width: 1px 0;border-inline-width: 1px 0;word-wrap: break-word;white-space: pre-wrap;&:first-of-type {border-start-start-radius: .5em}&:last-of-type {border-start-end-radius: .5em;border-inline-end-width: 1px}}tbody td {word-wrap: break-word;border-spacing: 0;border: solid 1px #666666;padding: .5ch 1ch;border-block-width: 1px 0;border-inline-width: 1px 0;word-wrap: break-word;white-space: pre-wrap;&:last-of-type {border-inline-end-width: 1px}}tbody th {border-spacing: 0;border: solid 1px #666666;padding: .5ch 1ch;border-block-width: 1px 0;border-inline-width: 1px 0;word-wrap: break-word;white-space: pre-wrap;text-align: left;}tbody tr:nth-of-type(odd) {background: #F2F2F2;}.kind_string {font-size: 0.75em;}.date_string {font-size: 0.5em;}tfoot th {border: solid 1px #666666;padding: .5ch 1ch;word-wrap: break-word;white-space: pre-wrap;&:first-of-type {border-end-start-radius: .5em}&:last-of-type {border-end-end-radius: .5em;border-inline-end-width: 1px}}")
ocidHeadElement's addChild:(ocidAddElement)
ocidRootElement's addChild:(ocidHeadElement)
  #
  #ボディエレメント
  set ocidBodyElement to refMe's NSXMLElement's elementWithName:("body")
  #ヘッダー
  set ocidHeaderElement to refMe's NSXMLElement's elementWithName:("header")
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("id") stringValue:("header")
ocidHeaderElement's addAttribute:(ocidAddNode)
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("class") stringValue:("body_header")
ocidHeaderElement's addAttribute:(ocidAddNode)
ocidHeaderElement's addChild:(argHeaderContents)
ocidBodyElement's addChild:(ocidHeaderElement)
  #アーティクル
  set ocidArticleElement to refMe's NSXMLElement's elementWithName:("article")
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("id") stringValue:("article")
ocidArticleElement's addAttribute:(ocidAddNode)
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("class") stringValue:("body_article")
ocidArticleElement's addAttribute:(ocidAddNode)
ocidArticleElement's addChild:(argArticleContents)
ocidBodyElement's addChild:(ocidArticleElement)
  #フッター
  set ocidFooterElement to refMe's NSXMLElement's elementWithName:("footer")
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("id") stringValue:("footer")
ocidFooterElement's addAttribute:(ocidAddNode)
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("class") stringValue:("body_footer")
ocidFooterElement's addAttribute:(ocidAddNode)
ocidFooterElement's addChild:(argFooterContents)
ocidBodyElement's addChild:(ocidFooterElement)
  #ボディをROOTエレメントにセット
ocidRootElement's addChild:(ocidBodyElement)
  #ROOTをXMLにセット
ocidXMLDoc's setRootElement:(ocidRootElement)
  #値を戻す
return ocidXMLDoc
end doMakeRootElement
##############################
### 今の日付日間 テキスト
##############################
to doGetDateNo(argDateFormat)
  ####日付情報の取得
  set ocidDate to current application's NSDate's |date|()
  ###日付のフォーマットを定義
  set ocidNSDateFormatter to current application's NSDateFormatter's alloc()'s init()
ocidNSDateFormatter's setLocale:(current application's NSLocale's localeWithLocaleIdentifier:"ja_JP_POSIX")
  set ocidTimeZone to refMe's NSTimeZone's alloc()'s initWithName:"Asia/Tokyo"
ocidNSDateFormatter's setTimeZone:(ocidTimeZone)
ocidNSDateFormatter's setDateFormat:(argDateFormat)
  set ocidDateAndTime to ocidNSDateFormatter's stringFromDate:ocidDate
  set strDateAndTime to ocidDateAndTime as text
return strDateAndTime
end doGetDateNo


##############################
### 行列入替
##############################
to doChgColRowTSV(argNsstring)
  #可変にして
  set ocidLineString to (refMe's NSMutableString's alloc()'s initWithCapacity:(0))
(ocidLineString's setString:(argNsstring))
  #改行をUNIXに強制
  set ocidLineStringLF to (ocidLineString's stringByReplacingOccurrencesOfString:("\r\n") withString:("\n"))
  set ocidLineString to (ocidLineStringLF's stringByReplacingOccurrencesOfString:("\r") withString:("\n"))
  #改行毎でリストにする
  set ocidCharSet to (refMe's NSCharacterSet's newlineCharacterSet)
  set ocidTextArray to (ocidLineString's componentsSeparatedByCharactersInSet:(ocidCharSet))
  #リストの数
  set numCntArray to (count of ocidTextArray) as integer
  #出力用のテキスト
  set ocidSaveString to refMe's NSMutableString's alloc()'s initWithCapacity:(0)
  set ocidColArray to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
  #1行目のテキストを取り出して
  set ocidFirsText to ocidTextArray's firstObject()
  #タブ区切りテキストにする
  set ocidFirstRowArray to ocidFirsText's componentsSeparatedByString:("\t")
  #1行目のリストの数
  set numCntFirstArray to (count of ocidFirstRowArray) as integer
  #2行目からの処理
  repeat with itemRowNo from 0 to (numCntFirstArray - 1) by 1
    #まずは1行目のデータを取り出して
    set ocidFirstItemText to (ocidFirstRowArray's objectAtIndex:(itemRowNo))
    #出力用テキストに追加しておく
(ocidSaveString's appendString:(ocidFirstItemText))
(ocidSaveString's appendString:("\t"))
    #2列目以降のデータを順に取り出して
    repeat with itemColNo from 1 to (numCntArray - 1) by 1
      #2行目以降を順番に取り出して
      set ocidLineText to (ocidTextArray's objectAtIndex:(itemColNo))
      #リストにする
      set ocidRowArray to (ocidLineText's componentsSeparatedByString:("\t"))
      #対象の列の値を取り出して
      set ocidLineItemText to (ocidRowArray's objectAtIndex:(itemRowNo))
      #追加していく
(ocidSaveString's appendString:(ocidLineItemText))
      #最後のデータにはタブ入れない
      if itemColNo < (numCntArray - 1) then
(ocidSaveString's appendString:("\t"))
      end if
    end repeat
(ocidSaveString's appendString:("\n"))
  end repeat
  
return ocidSaveString
end doChgColRowTSV






|

サポート情報(公開用)

support-sp.apple.com/sp/productの不具合に対応

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

#!/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 appFileManager to refMe's NSFileManager's defaultManager()
set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace()


###アプリケーションディレクトリ
set ocidUserLibraryPathArray to (appFileManager's URLsForDirectory:(refMe's NSApplicationDirectory) inDomains:(refMe's NSUserDomainMask))
###URL
set ocidAppDirPathURL to ocidUserLibraryPathArray's firstObject()
set aliaAppDirPath to (ocidAppDirPathURL's absoluteURL()) as alias

#####ダイアログを前面に
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 listUTI to {"com.apple.application-bundle"}

set aliasAppPath to (choose file with prompt "対象のアプリケーションを選んでください" default location (aliaAppDirPath) of type listUTI with invisibles without showing package contents and multiple selections allowed) as alias
###パス
set strAppPath to POSIX path of aliasAppPath
set ocidAppPathStr to refMe's NSString's stringWithString:(strAppPath)
set ocidAppPath to ocidAppPathStr's stringByStandardizingPath()
set ocidAppPathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidAppPath) isDirectory:true)

#####################################
######ファイル保存先
#####################################
set ocidUserLibraryPathArray to (appFileManager's URLsForDirectory:(refMe's NSDocumentDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidFilePathURL to ocidUserLibraryPathArray's firstObject()
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)
#####################################
###### ioreg PLIST
#####################################
set ocidIoregFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:"ioreg.plist"
###古いファイルはゴミ箱に
set boolResults to (appFileManager's trashItemAtURL:(ocidIoregFilePathURL) resultingItemURL:(missing value) |error|:(reference))
#####################################
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:(ocidIoregFilePathURL) atomically:true

###PLIST初期化して
set listResults to refMe's NSPropertyListSerialization's propertyListWithData:ocidPlisStringstData options:0 format:(refMe's NSPropertyListXMLFormat_v1_0) |error|:(reference)
###各種値を取得する NSSingleObjectArray に留意
set ocidPlistDataArray to item 1 of listResults
set ocidDeviceUUIDArray to (ocidPlistDataArray's valueForKeyPath:"IORegistryEntryChildren.IOPlatformUUID")
set ocidDeviceUUID to ocidDeviceUUIDArray's firstObject()
set ocidDeviceSerialNumberArray to (ocidPlistDataArray's valueForKeyPath:"IORegistryEntryChildren.IOPlatformSerialNumber")
set ocidDeviceSerialNumber to ocidDeviceSerialNumberArray's firstObject()
set ocidDeviceEntryNameArray to (ocidPlistDataArray's valueForKeyPath:"IORegistryEntryChildren.IORegistryEntryName")
set ocidDeviceEntryName to ocidDeviceEntryNameArray's firstObject()
###モデル名はNSDATAなのでテキストに解凍する
set ocidModelArray to (ocidPlistDataArray's valueForKeyPath:("IORegistryEntryChildren.model"))
set ocidModel to ocidModelArray's firstObject()
###まぁエラーになるとは思えないが
if (className() of ocidModel as text) is "NSNull" then
  set strCommandText to ("/usr/sbin/sysctl -n hw.model") as text
  set strModelStr to (do shell script strCommandText) as text
else
  set ocidModelStr to refMe's NSString's alloc()'s initWithData:(ocidModel) encoding:(refMe's NSUTF8StringEncoding)
  set strModelStr to ocidModelStr as text
end if
#####################################
######サポート情報取得
#####################################
set ocidAppBundle to refMe's NSBundle's bundleWithURL:(ocidAppPathURL)
###基本情報を取得
set ocidInfoDict to ocidAppBundle's infoDictionary
###PLISTのURLを取得して
# set ocidPlistPathURL to ocidAppBundlePathURL's URLByAppendingPathComponent:("Contents/Info.plist") isDirectory:false
###読み込む
#set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithContentsOfURL:(ocidPlistPathURL)
set ocidBundleName to ocidInfoDict's valueForKey:("CFBundleName")
set ocidBundleExecutable to ocidInfoDict's valueForKey:("CFBundleExecutable")
set ocidBundleDisplayName to ocidInfoDict's valueForKey:("CFBundleDisplayName")

set ocidBundleVersion to ocidInfoDict's valueForKey:("CFBundleVersion")
set ocidBuild to ocidInfoDict's valueForKey:("DTSDKBuild")
set ocidShortVersionString to ocidInfoDict's valueForKey:("CFBundleShortVersionString")
###クローム用
set ocidChannelID to ocidInfoDict's valueForKey:("KSChannelID")
###Acrobat用
set ocidTrackName to ocidInfoDict's valueForKey:("TrackName")

#####################################
###### diskutil PLIST
#####################################
set ocidDiskutilFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:"diskutil.plist"
###古いファイルはゴミ箱に
set boolResults to (appFileManager's trashItemAtURL:(ocidDiskutilFilePathURL) resultingItemURL:(missing value) |error|:(reference))
#####################################
set strCommandText to "/usr/sbin/diskutil info -plist /" 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:(ocidDiskutilFilePathURL) atomically:true
###PLIST初期化して
set listResults to refMe's NSPropertyListSerialization's propertyListWithData:ocidPlisStringstData options:0 format:(refMe's NSPropertyListXMLFormat_v1_0) |error|:(reference)
###各種値を取得する NSSingleObjectArray に留意
set ocidPlistDataArray to item 1 of listResults
###ボリューム名 他
set ocidVolumeName to (ocidPlistDataArray's valueForKey:"VolumeName")
set ocidDiskUUID to (ocidPlistDataArray's valueForKey:"DiskUUID")
set ocidVolumeUUID to (ocidPlistDataArray's valueForKey:"VolumeUUID")
set ocidFilesystemName to (ocidPlistDataArray's valueForKey:"FilesystemName")
set ocidFileVault to (ocidPlistDataArray's valueForKey:"FileVault")
set ocidEncryption to (ocidPlistDataArray's valueForKey:"Encryption")
###サイズ
set ocidTotalSize to (ocidPlistDataArray's valueForKey:"TotalSize")
set intGB to "1073741824" as integer
set ocidGB to (refMe's NSNumber's numberWithInteger:intGB)
set intTotalSize to ((ocidTotalSize's doubleValue as real) / (ocidGB's doubleValue as real)) as integer
###残
set ocidAPFSContainerFree to (ocidPlistDataArray's valueForKey:"APFSContainerFree")
set intGB to "1073741824" as integer
set ocidGB to (refMe's NSNumber's numberWithInteger:intGB)
set intContainerFree to ((ocidAPFSContainerFree's doubleValue as real) / (ocidGB's doubleValue as real)) as integer
########################
##メモリサイズを調べる
set ocidProcessInfo to refMe's NSProcessInfo's processInfo()
set realMemoryByte to ocidProcessInfo's physicalMemory() as real
set realGB to "1073741824" as real
set intPhysicalMemory to realMemoryByte / realGB as integer
##ユーザー情報
set ocidEnvDict to ocidProcessInfo's environment()
set strHOME to (ocidEnvDict's valueForKey:"HOME") as text
set strUSER to (ocidEnvDict's valueForKey:"USER") as text
set strLOGNAME to (ocidEnvDict's valueForKey:"LOGNAME") as text
set strTMPDIR to (ocidEnvDict's valueForKey:"TMPDIR") as text
########################
###OSのバージョン
set ocidSystemPathArray to (appFileManager's URLsForDirectory:(refMe's NSCoreServiceDirectory) inDomains:(refMe's NSSystemDomainMask))
set ocidCoreServicePathURL to ocidSystemPathArray's firstObject()
set ocidPlistFilePathURL to ocidCoreServicePathURL's URLByAppendingPathComponent:"SystemVersion.plist"
set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithContentsOfURL:(ocidPlistFilePathURL)
set strOSversion to (ocidPlistDict's valueForKey:("ProductVersion")) as text
########################
###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
(*
###モデル名を取得 configCode
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
##
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()
###configCodeからモデル名を取得
set ocidConfigCode to ocidRootElement's elementsForName:"configCode"
set strConfigCode to ocidConfigCode's stringValue as text
*)
####CPUタイプ
set strCPU to CPU type of (system info) as text
log strConfigCode as text

########################
###ダイアログ
set strIconPath to "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/FinderIcon.icns" as text
set aliasIconPath to POSIX file strIconPath as alias


set strAns to ("モデル名:" & strConfigCode & "\r") as text
set strAns to (strAns & "OSバージョン:" & strOSversion & "\r") as text
set strAns to (strAns & "物理メモリ:" & intPhysicalMemory & " GB\r") as text
set strAns to (strAns & "CFBundleExecutable:" & ocidBundleExecutable & "\r") as text
set strAns to (strAns & "ShortVersion:" & ocidShortVersionString & "\r") as text



#####ダイアログを前面に
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 "ioreg 戻り値です\rコピーしてメールかメッセージを送ってください\r※相手が信用出来ない場合は削除" with title "サポート情報" default answer strAns buttons {"クリップボードにコピー", "キャンセル", "OK"} default button "OK" cancel button "キャンセル" giving up after 30 with icon aliasIconPath without hidden answer)
###クリップボードコピー
if button returned of recordResult is "クリップボードにコピー" then
  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)
end if

|

[まとめ]System Informationとsystem_profiler

system_profilerはDataTypeを指定すれば
それほど時間はかからない

ダウンロード - system20information.zip


DataTypeはコマンドから取得できる
/usr/sbin/system_profiler -listDataTypes


SPParallelATADataType
SPUniversalAccessDataType
SPSecureElementDataType
SPApplicationsDataType
SPAudioDataType
SPBluetoothDataType
SPCameraDataType
SPCardReaderDataType
SPiBridgeDataType
SPDeveloperToolsDataType
SPDiagnosticsDataType
SPDisabledSoftwareDataType
SPDiscBurningDataType
SPEthernetDataType
SPExtensionsDataType
SPFibreChannelDataType
SPFireWireDataType
SPFirewallDataType
SPFontsDataType
SPFrameworksDataType
SPDisplaysDataType
SPHardwareDataType
SPInstallHistoryDataType
SPInternationalDataType
SPLegacySoftwareDataType
SPNetworkLocationDataType
SPLogsDataType
SPManagedClientDataType
SPMemoryDataType
SPNVMeDataType
SPNetworkDataType
SPPCIDataType
SPParallelSCSIDataType
SPPowerDataType
SPPrefPaneDataType
SPPrintersSoftwareDataType
SPPrintersDataType
SPConfigurationProfileDataType
SPRawCameraDataType
SPSASDataType
SPSerialATADataType
SPSPIDataType
SPSmartCardsDataType
SPSoftwareDataType
SPStartupItemDataType
SPStorageDataType
SPSyncServicesDataType
SPThunderboltDataType
SPUSBDataType
SPNetworkVolumeDataType
SPWWANDataType
SPAirPortDataType

|

[ダイアログ表示]SPHardwareDataType


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

#!/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 framework "AppKit"
use scripting additions

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

#####################################
######コマンド実行
#####################################
set strCommandText to "/usr/sbin/system_profiler SPHardwareDataType -xml"
set strReadString to (do shell script strCommandText) as text

#####################################
######PLIST をDictで処理
#####################################
###戻り値をストリングに
set ocidReadString to refMe's NSString's stringWithString:(strReadString)
###NSDATAにして
set ocidReadData to ocidReadString's dataUsingEncoding:(refMe's NSUTF8StringEncoding)
###PLISTに変換
set listResults to refMe's NSPropertyListSerialization's propertyListWithData:(ocidReadData) options:0 format:(refMe's NSPropertyListXMLFormat_v1_0) |error|:(reference)
set ocidPlistDataArray to item 1 of listResults
##ここがroot
set ocidPlistRoot to ocidPlistDataArray's firstObject()
##item0
set ocidRootDict to (refMe's NSDictionary's alloc()'s initWithDictionary:(ocidPlistRoot))
##ITEMS
set ocidItemsArray to (ocidRootDict's objectForKey:("_items"))
##item0
set ocidItemsDict to ocidItemsArray's firstObject()
##キーの値をリストで取り
set ocidAllKeys to ocidItemsDict's allKeys()
set strOutPutText to ("") as text
repeat with itemAllKeys in ocidAllKeys
  set strAllKey to itemAllKeys as text
  set strValue to (ocidItemsDict's valueForKey:(itemAllKeys)) as text
  set strOutPutText to (strOutPutText & strAllKey & ": " & strValue & "\n") as text
end repeat


#####ダイアログを前面に
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 strIconPath to "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/FinderIcon.icns" as text
set aliasIconPath to POSIX file strIconPath as alias
###ダイアログ
set recordResult to (display dialog " 戻り値です\rコピーしてメールかメッセージを送ってください" with title "SPHardwareDataType" default answer strOutPutText buttons {"クリップボードにコピー", "キャンセル", "OK"} default button "OK" giving up after 30 with icon aliasIconPath without hidden answer)
###クリップボードコピー
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
end if


|

[ダイアログ表示]SPSoftwareDataType


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

#!/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 framework "AppKit"
use scripting additions

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

#####################################
######ファイル保存先
#####################################
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/system_profiler"
############################
#####属性
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:"SPSoftwareDataType.json"
set strFilePath to (ocidFilePathURL's |path|()) as text
###古いファイルはゴミ箱に
set boolResults to (appFileManager's trashItemAtURL:ocidFilePathURL resultingItemURL:(missing value) |error|:(reference))
#####################################
######コマンド実行
#####################################
set strCommandText to "/usr/sbin/system_profiler SPSoftwareDataType -json"
set strReadString to (do shell script strCommandText) as text
###戻り値をストリングに
set ocidReadString to refMe's NSString's stringWithString:(strReadString)
###NSDATAにして
set ocidReadData to ocidReadString's dataUsingEncoding:(refMe's NSUTF8StringEncoding)
###ファイルに書き込み(使い回し用)-->不要な場合は削除して
ocidReadData's writeToURL:(ocidFilePathURL) atomically:true
#####################################
######JOSN をDictで処理
#####################################

set listJSONSerialization to (refMe's NSJSONSerialization's JSONObjectWithData:(ocidReadData) options:0 |error|:(reference))
set ocidJsonData to item 1 of listJSONSerialization
set ocidJsonRootDict to (refMe's NSDictionary's alloc()'s initWithDictionary:(ocidJsonData))
set ocidDataTypeArray to (ocidJsonRootDict's objectForKey:("SPSoftwareDataType"))
set ocidJsonDict to ocidDataTypeArray's firstObject()
set ocidAllKeys to ocidJsonDict's allKeys()
log ocidAllKeys as list
set strOutPutText to ("") as text
repeat with itemAllKeys in ocidAllKeys
  set strAllKey to itemAllKeys as text
  set strValue to (ocidJsonDict's valueForKey:(itemAllKeys)) as text
  set strOutPutText to (strOutPutText & strAllKey & ": " & strValue & "\n") as text
end repeat

#####ダイアログを前面に
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 strIconPath to "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/FinderIcon.icns" as text
set aliasIconPath to POSIX file strIconPath as alias
###ダイアログ
set recordResult to (display dialog " 戻り値です\rコピーしてメールかメッセージを送ってください" with title "SPSoftwareDataType" default answer strOutPutText buttons {"クリップボードにコピー", "キャンセル", "OK"} default button "OK" giving up after 30 with icon aliasIconPath without hidden answer)
###クリップボードコピー
if button returned of recordResult is "クリップボードにコピー" then
  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:(strOutPutText))
appPasteboard's clearContents()
appPasteboard's setString:(ocidText) forType:(refMe's NSPasteboardTypeString)
end if

|

[System Information]システム情報 全部保存


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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
# 【注意】 実行後5分ほど時間がかかります
#(インストールしているアプリケーションの数によって増減します)
#
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
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()

#####################################
######ファイル保存先
#####################################
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/system_profiler"
############################
#####属性 511 --> 777
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)
#####################################
######DataTypesを取得
#####################################
set strCommandText to ("/usr/sbin/system_profiler -listDataTypes")
set strResponse to (do shell script strCommandText) as text
set ocidListDataTypes to refMe's NSString's stringWithString:(strResponse)
##
set ocidListDataTypeArray to ocidListDataTypes's componentsSeparatedByString:("\r")
#####################################
######ocidListDataTypeの数だけ繰り返し
#####################################
repeat with itemListDataTypeArray in ocidListDataTypeArray
  set strItemListDataTypeArray to itemListDataTypeArray as text
  ###保存先パス
  set ocidPlistPathURL to (ocidSaveDirPathURL's URLByAppendingPathComponent:(strItemListDataTypeArray & ".plist"))
  set ocidJsonPathURL to (ocidSaveDirPathURL's URLByAppendingPathComponent:(strItemListDataTypeArray & ".json"))
  set strPlistPath to (ocidPlistPathURL's |path|()) as text
  set strJsonPath to (ocidJsonPathURL's |path|()) as text
  ##
  ###古いファイルはゴミ箱に
  set listDone to (appFileManager's trashItemAtURL:(ocidPlistPathURL) resultingItemURL:(ocidPlistPathURL) |error|:(reference))
  set listDone to (appFileManager's trashItemAtURL:(ocidJsonPathURL) resultingItemURL:(ocidJsonPathURL) |error|:(reference))
  ###
  set strCommandText to "/usr/sbin/system_profiler " & strItemListDataTypeArray & " -xml > \"" & strPlistPath & "\""
  do shell script strCommandText
  set strCommandText to "/usr/sbin/system_profiler " & strItemListDataTypeArray & " -json > \"" & strJsonPath & "\""
  do shell script strCommandText
  
end repeat





|

OS14の場合処理を停止する


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

#!/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 scripting additions

property refMe : a reference to current application
##OSのバージョンを取得
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidSystemPathArray to (appFileManager's URLsForDirectory:(refMe's NSCoreServiceDirectory) inDomains:(refMe's NSSystemDomainMask))
set ocidCoreServicePathURL to ocidSystemPathArray's firstObject()
set ocidPlistFilePathURL to ocidCoreServicePathURL's URLByAppendingPathComponent:("SystemVersion.plist")
set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithContentsOfURL:(ocidPlistFilePathURL)
set strOSversion to (ocidPlistDict's valueForKey:("ProductVersion")) as text
set numOSversion to strOSversion as number
if numOSversion ≥ 14 then
return "OS13までの機能です"
end if


|

[SPAirPortDataType]システム情報 DBの内容をダイアログ表示して取得


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

#!/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 framework "AppKIt"
use scripting additions

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

#####################################
######ファイル保存先
#####################################
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/system_profiler"
############################
#####属性
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:"SPAirPortDataType.json"
set strFilePath to (ocidFilePathURL's |path|()) as text
###古いファイルはゴミ箱に
set boolResults to (appFileManager's trashItemAtURL:ocidFilePathURL resultingItemURL:(missing value) |error|:(reference))
#####################################
######コマンド実行
#####################################
set strCommandText to "/usr/sbin/system_profiler SPAirPortDataType -json"
set strReadString to (do shell script strCommandText) as text
###戻り値をストリングに
set ocidReadString to refMe's NSString's stringWithString:(strReadString)
###NSDATAにして
set ocidReadData to ocidReadString's dataUsingEncoding:(refMe's NSUTF8StringEncoding)
###ファイルに書き込み(使い回し用)-->不要な場合は削除して
ocidReadData's writeToURL:(ocidFilePathURL) atomically:true
#####################################
######JOSN をDictで処理
#####################################
set listJSONSerialization to (refMe's NSJSONSerialization's JSONObjectWithData:(ocidReadData) options:0 |error|:(reference))
set ocidJsonData to item 1 of listJSONSerialization
set ocidJsonRootDict to (refMe's NSDictionary's alloc()'s initWithDictionary:(ocidJsonData))
set ocidDataTypeArray to (ocidJsonRootDict's valueForKeyPath:("SPAirPortDataType.spairport_airport_interfaces"))
set ocidJsonDict to (ocidDataTypeArray's firstObject())'s firstObject()
set ocidAllKeys to ocidJsonDict's allKeys()
set strOutPutText to ("") as text
repeat with itemAllKeys in ocidAllKeys
  set strAllKey to itemAllKeys as text
  set ocidValue to (ocidJsonDict's valueForKey:(itemAllKeys))
  if (className() of ocidValue as text) contains "NSDictionary" then
    log "Dictは処理しない"
  else if (className() of ocidValue as text) contains "NSArray" then
    log "Arrayは処理しない"
  else
    set strValue to ocidValue as text
    set strOutPutText to (strOutPutText & strAllKey & ": " & strValue & "\n") as text
  end if
end repeat


#####ダイアログを前面に
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 strIconPath to "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/FinderIcon.icns" as text
set aliasIconPath to POSIX file strIconPath as alias
###ダイアログ
set recordResult to (display dialog " 戻り値です\rコピーしてメールかメッセージを送ってください" with title "SPHardwareDataType" default answer strOutPutText buttons {"クリップボードにコピー", "キャンセル", "OK"} default button "OK" giving up after 30 with icon aliasIconPath without hidden answer)
###クリップボードコピー
if button returned of recordResult is "クリップボードにコピー" then
  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:(strOutPutText))
appPasteboard's clearContents()
appPasteboard's setString:(ocidText) forType:(refMe's NSPasteboardTypeString)
end if

|

[SPConfigurationProfileData]システム情報 DBの内容をダイアログ表示して取得


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

#!/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 framework "AppKIt"
use scripting additions

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

#####################################
######ファイル保存先
#####################################
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/system_profiler"
############################
#####属性
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:"SPConfigurationProfileDataType.json"
set strFilePath to (ocidFilePathURL's |path|()) as text
###古いファイルはゴミ箱に
set boolResults to (appFileManager's trashItemAtURL:ocidFilePathURL resultingItemURL:(missing value) |error|:(reference))
#####################################
######コマンド実行
#####################################
set strCommandText to "/usr/sbin/system_profiler SPConfigurationProfileDataType -json"
set strReadString to (do shell script strCommandText) as text
###戻り値をストリングに
set ocidReadString to refMe's NSString's stringWithString:(strReadString)
###NSDATAにして
set ocidReadData to ocidReadString's dataUsingEncoding:(refMe's NSUTF8StringEncoding)
###ファイルに書き込み(使い回し用)-->不要な場合は削除して
ocidReadData's writeToURL:(ocidFilePathURL) atomically:true
#####################################
######JOSN をDictで処理
#####################################
set listJSONSerialization to (refMe's NSJSONSerialization's JSONObjectWithData:(ocidReadData) options:0 |error|:(reference))
set ocidJsonData to item 1 of listJSONSerialization
set ocidJsonRootDict to (refMe's NSDictionary's alloc()'s initWithDictionary:(ocidJsonData))
set ocidDataTypeArray to (ocidJsonRootDict's objectForKey:("SPConfigurationProfileDataType"))
set strUserOutPutText to ("Userプロファイル:\n") as text
set strDeviceOutPutText to ("Deveiceプロファイル:\n") as text
repeat with itemDataTypeArray in ocidDataTypeArray
  set strName to (itemDataTypeArray's valueForKey:("_name")) as text
  set ocidItemArray to (itemDataTypeArray's objectForKey:("_items"))
  repeat with itemItemArray in ocidItemArray
    ###とりあえずプロファイル名のみ
    set strProfileName to (itemItemArray's valueForKey:("_name")) as text
    ##必要に応じて項目を追加するといいね
    # set strProfileUUID to (itemItemArray's valueForKey:("spconfigprofile_profile_uuid")) as text
    # set strProfileID to (itemItemArray's valueForKey:("spconfigprofile_profile_identifier")) as text
    if strName is "spconfigprofile_section_userconfigprofiles" then
      set strUserOutPutText to (strUserOutPutText & strProfileName & "\n")
    else if strName is "spconfigprofile_section_deviceconfigprofiles" then
      set strDeviceOutPutText to (strDeviceOutPutText & strProfileName & "\n") as text
    end if
  end repeat
end repeat
log strUserOutPutText
log strDeviceOutPutText

set strOutPutText to (strUserOutPutText & "\n" & strDeviceOutPutText) as text

#####ダイアログを前面に
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 strIconPath to "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/FinderIcon.icns" as text
set aliasIconPath to POSIX file strIconPath as alias
###ダイアログ
set recordResult to (display dialog " 戻り値です\rコピーしてメールかメッセージを送ってください" with title "SPConfigurationProfileDataType" default answer strOutPutText buttons {"クリップボードにコピー", "キャンセル", "OK"} default button "OK" giving up after 30 with icon aliasIconPath without hidden answer)
###クリップボードコピー
if button returned of recordResult is "クリップボードにコピー" then
  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:(strOutPutText))
appPasteboard's clearContents()
appPasteboard's setString:(ocidText) forType:(refMe's NSPasteboardTypeString)
end if

|

その他のカテゴリー

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