[AppleScript]Dict Arrayの入れ子(ネスト)
前も書いたと思うんですが…
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
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」カテゴリの記事
- [AppleScript]Dict Arrayの入れ子(ネスト)(2021.10.10)
- [Script]ARMアップルシリコンとINTELの分岐(2021.05.23)
- Function Key Codes(2020.09.06)
- Read My Scripts.app (Mountain Lion は AppleScript のルールをどう変更したか)(2012.08.12)
- [system info]ipアドレスを取得する。(2010.11.30)