« open com.apple.preferences.configurationprofiles | トップページ | Adobe Content Authenticity Initiative (CAI) 記事修正 »

[AppleScript]Dict Arrayの入れ子(ネスト)

20211009-235907


前も書いたと思うんですが…
defaults write hoge.foo.appid '{theDict = {theArray = (STRING);};}'
です

set theComandText to ("defaults write /Users/Shared/Library/Preferences/com.apple.ScriptEditor2.plist '{ \"NSToolbar Configuration Document Toolbar Identifier\" = {\"TB Item Identifiers\" = (\"NSToolbarFlexibleSpaceItem\",\"Show Event Log History Toolbar Item Identifier\",\"NSToolbarFlexibleSpaceItem\",\"Record Script Toolbar Item Identifier\",\"Stop Script Toolbar Item Identifier\",\"Run Script Toolbar Item Identifier\",\"NSToolbarFlexibleSpaceItem\",\"Check Syntax Toolbar Item Identifier\",\"NSToolbarFlexibleSpaceItem\",\"Run Script Application Toolbar Item Identifier\",\"Show View Toolbar Item Identifier\",\"NSToolbarFlexibleSpaceItem\",\"Print Toolbar Item Identifier\");};}'") as text
do shell script theComandText

ダウンロード - nest.scpt.zip

XMLで書いちゃうのもあり

set theComandText to ("defaults write /Users/Shared/Library/Preferences/com.apple.ScriptEditor2.plist \"NSToolbar Configuration Document Toolbar Identifier\" \"<dict><key>TB Item Identifiers</key><array><string>NSToolbarFlexibleSpaceItem</string><string>Show Event Log History Toolbar Item Identifier</string><string>NSToolbarFlexibleSpaceItem</string><string>Record Script Toolbar Item Identifier</string><string>Stop Script Toolbar Item Identifier</string><string>Run Script Toolbar Item Identifier</string><string>NSToolbarFlexibleSpaceItem</string><string>Check Syntax Toolbar Item Identifier</string><string>NSToolbarFlexibleSpaceItem</string><string>Run Script Application Toolbar Item Identifier</string><string>Show View Toolbar Item Identifier</string><string>NSToolbarFlexibleSpaceItem</string><string>Print Toolbar Item Identifier</string></array></dict>\"") as text
do shell script theComandText

|

« open com.apple.preferences.configurationprofiles | トップページ | Adobe Content Authenticity Initiative (CAI) 記事修正 »

AppleScriptBasics」カテゴリの記事