PlistBuddy

[PlistBuddy]設定変更の流れ(ユーザー選択)


AppleScript サンプルコード

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

AppleScript サンプルソース(参考)
行番号ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003#com.cocolog-nifty.quicktimer.icefloe
004# 設定変更をユーザーが選択するパターンのサンプル
005# PlistBuddyの場合 フルパスを指定する必要があり
006# デバイスのUUIDを取得する処理が別途必要
007----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
008use AppleScript version "2.8"
009use framework "Foundation"
010use framework "UniformTypeIdentifiers"
011use framework "AppKit"
012use scripting additions
013
014property refMe : a reference to current application
015
016##################
017#保存先確保
018set appFileManager to refMe's NSFileManager's defaultManager()
019set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDocumentDirectory) inDomains:(refMe's NSUserDomainMask))
020set ocidDocumentDirPathURL to ocidURLsArray's firstObject()
021set ocidSaveDirPathURL to ocidDocumentDirPathURL's URLByAppendingPathComponent:("Apple/IOreg") isDirectory:(true)
022set ocidAttrDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
023ocidAttrDict's setValue:(448) forKey:(refMe's NSFilePosixPermissions)
024set listBoolMakeDir to appFileManager's createDirectoryAtURL:(ocidSaveDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error| :(reference)
025#保存パス
026set ocidSaveFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:("IOPlatformExpertDevice.plist") isDirectory:(false)
027set strSaveFilePath to ocidSaveFilePathURL's |path| as text
028
029##################
030#ioregの取得 plist保存
031# rd1=第一階層のみ c=プロパティのみ表示
032set strCommandText to ("/usr/sbin/ioreg -rd1 -c IOPlatformExpertDevice -a  > \"" & strSaveFilePath & "\"") as text
033log ("実行したコマンド\r" & strCommandText & "\r") as text
034set strExecCommand to ("/bin/zsh -c \"" & strCommandText & "\"") as text
035try
036  set strResponse to (do shell script strExecCommand) as text
037on error
038  log "zshでエラーになりました\r" & strCommandText & "\r"
039end try
040
041##################
042#値の取得
043set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:0:IOPlatformUUID\"  \"" & strSaveFilePath & "\"") as text
044log ("実行したコマンド\r" & strCommandText & "\r") as text
045set strExecCommand to ("/bin/zsh -c \"" & strCommandText & "\"") as text
046try
047  set strResponse to (do shell script strExecCommand) as text
048on error
049  log "zshでエラーになりました\r" & strCommandText & "\r"
050end try
051
052##################
053#ByHost設定ファイルの定義
054set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSLibraryDirectory) inDomains:(refMe's NSUserDomainMask))
055set ocidLibraryDirPathURL to ocidURLsArray's firstObject()
056set ocidByHostDirPathURL to ocidLibraryDirPathURL's URLByAppendingPathComponent:("Preferences/ByHost") isDirectory:(true)
057set strByHostDirPath to ocidByHostDirPathURL's |path| as text
058set strPlistFilePath to (strByHostDirPath & "/com.apple.Spotlight." & strResponse & ".plist") as text
059
060##################
061#現在の設定値の確認
062set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:MenuItemHidden\"  \"" & strPlistFilePath & "\"") as text
063log ("\r" & strCommandText & "\r") as text
064set strExecCommand to ("/bin/zsh -c \"" & strCommandText & "\"") as text
065try
066  set strResponse to (do shell script strExecCommand) as text
067on error
068  log "zshでエラーになりました\r" & strCommandText & "\r"
069end try
070
071##################
072#戻り値による分岐
073if strResponse is "true" then
074  set strMes to ("現在の設定はTRUE:1ですFALSE:0にしますか?") as text
075  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:MenuItemHidden false\"  \"" & strPlistFilePath & "\"") as text
076else if strResponse is "false" then
077  set strMes to ("現在の設定はFALSE:0ですTRUE:1にしますか?") as text
078  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:MenuItemHidden true\"  \"" & strPlistFilePath & "\"") as text
079end if
080
081##################
082#アラート選択
083try
084  #前面に
085  set strName to (name of current application) as text
086  if strName is "osascript" then
087    tell application "Finder" to activate
088  else
089    tell current application to activate
090  end if
091  set recordResponse to (display alert strMes buttons {"OK", "キャンセル"} default button "OK" cancel button "キャンセル" as informational giving up after 10) as record
092on error
093  log "キャンセルしました。"
094  return "キャンセルしました。"
095end try
096if true is equal to (gave up of recordResponse) then
097  return "時間切れです。"
098end if
099#アラートの戻り値
100set strBottonName to (button returned of recordResponse) as text
101
102
103##################
104#戻り値でコマンドを実行する
105if "OK" is equal to (strBottonName) then
106  log ("\r" & strCommandText & "\r") as text
107  set strExecCommand to ("/bin/zsh -c '" & strCommandText & "'") as text
108  try
109    set strResponse to (do shell script strExecCommand) as text
110  on error
111    log "zshでエラーになりました\r" & strCommandText & "\r"
112  end try
113end if
114
115##################
116#PlistBuddy Save
117set strCommandText to ("/usr/libexec/PlistBuddy -c \"Save\"  \"" & strPlistFilePath & "\"") as text
118log ("\r" & strCommandText & "\r") as text
119set strExecCommand to ("/bin/zsh -c \"" & strCommandText & "\"") as text
120try
121  set strResponse to (do shell script strExecCommand) as text
122on error
123  log "zshでエラーになりました\r" & strCommandText & "\r"
124end try
125
126##################
127
128
129return
AppleScriptで生成しました

|

パージョンを取得する(defaults , PlistBuddy,plutil)


あくまでも参考にしてください

サンプルソース(参考)
行番号ソース
001#! /bin/bash
002#com.cocolog-nifty.quicktimer.icefloe
003#バージョンを調べる
004#################################################
005#OS  ProductVersion
006/usr/bin/defaults read "/System/Library/CoreServices/SystemVersion.plist" ProductVersion
007#OS ProductUserVisibleVersion
008/usr/libexec/PlistBuddy -c "Print:ProductUserVisibleVersion" "/System/Library/CoreServices/SystemVersion.plist"
009#OS
010/usr/bin/plutil -extract ProductVersion raw -expect string "/System/Library/CoreServices/SystemVersion.plist" 
011
012#################################################
013#アプリケーション CFBundleShortVersionStringの値を取る
014STR_APP_PATH="/Applications/Safari.app"
015STR_PLIST_PATH="${STR_APP_PATH}/Contents/Info.plist"
016#
017/usr/bin/defaults read "$STR_PLIST_PATH" CFBundleShortVersionString
018#
019/usr/libexec/PlistBuddy -c "Print:CFBundleShortVersionString" "$STR_PLIST_PATH"
020#
021/usr/bin/plutil -extract CFBundleShortVersionString raw -expect string "$STR_PLIST_PATH" 
022#################################################
023#アプリケーション CFBundleVersionの値を取る version.plistがある場合
024STR_APP_PATH="/Applications/Safari.app"
025STR_PLIST_PATH="${STR_APP_PATH}/Contents/version.plist"
026#
027/usr/bin/defaults read "$STR_PLIST_PATH" CFBundleVersion
028#
029/usr/libexec/PlistBuddy -c "Print:CFBundleVersion" "$STR_PLIST_PATH"
030#
031/usr/bin/plutil -extract CFBundleVersion raw -expect string "$STR_PLIST_PATH" 
032
033#################################################
034#アプリケーション CFBundleVersionを取得する一般的にはこの方法
035STR_APP_PATH="/Applications/Adobe Acrobat Reader.app"
036STR_PLIST_PATH="${STR_APP_PATH}/Contents/Info.plist"
037#
038/usr/bin/defaults read "$STR_PLIST_PATH" CFBundleVersion
039#
040/usr/libexec/PlistBuddy -c "Print:CFBundleVersion" "$STR_PLIST_PATH"
041#
042/usr/bin/plutil -extract CFBundleVersion raw -expect string "$STR_PLIST_PATH" 
043
044exit 0
AppleScriptで生成しました

|

[bash][PlistBuddy]基本設定unarchiver


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

#!/bin/bash
#com.cocolog-nifty.quicktimer.icefloe
#####################################

LIST_BUNDLEID=("com.macpaw.site.theunarchiver.plist" "cx.c3.theunarchiver.plist")

for ITEM_BUNDLEID in "${LIST_BUNDLEID[@]}"; do
/bin/echo "$ITEM_BUNDLEID"
STR_PLIST_FILEPATH="$HOME/Library/Preferences/$ITEM_BUNDLEID"
/bin/echo "$STR_PLIST_FILEPATH"
  if [ -e "STR_PLIST_FILEPATH" ]; then
/usr/libexec/PlistBuddy -c "Save" "$STR_PLIST_FILEPATH"
  fi
  #####
STR_VALUE=$(/usr/libexec/PlistBuddy -c "Print:createFolder" "$STR_PLIST_FILEPATH")
  if [ $? -eq 0 ]; then
    if [ "$STR_VALUE" -ne 2 ]; then
/usr/libexec/PlistBuddy -c "Set:createFolder 2" "$STR_PLIST_FILEPATH"
    fi
  else
/usr/libexec/PlistBuddy -c "Add:createFolder integer 2" "$STR_PLIST_FILEPATH"
  fi
  #####
STR_VALUE=$(/usr/libexec/PlistBuddy -c "Print:extractionDestination" "$STR_PLIST_FILEPATH")
  if [ $? -eq 0 ]; then
    if [ "$STR_VALUE" -ne 1 ]; then
/usr/libexec/PlistBuddy -c "Set:extractionDestination 1" "$STR_PLIST_FILEPATH"
    fi
  else
/usr/libexec/PlistBuddy -c "Add:extractionDestination integer 1" "$STR_PLIST_FILEPATH"
  fi
  #####
STR_VALUE=$(/usr/libexec/PlistBuddy -c "Print:folderModifiedDate" "$STR_PLIST_FILEPATH")
  if [ $? -eq 0 ]; then
    if [ "$STR_VALUE" -ne 2 ]; then
/usr/libexec/PlistBuddy -c "Set:folderModifiedDate 2" "$STR_PLIST_FILEPATH"
    fi
  else
/usr/libexec/PlistBuddy -c "Add:folderModifiedDate integer 2" "$STR_PLIST_FILEPATH"
  fi
  #####
STR_VALUE=$(/usr/libexec/PlistBuddy -c "Print:LaunchCount" "$STR_PLIST_FILEPATH")
  if [ $? -eq 0 ]; then
    if [ "$STR_VALUE" -ne 0 ]; then
/usr/libexec/PlistBuddy -c "Set:LaunchCount 0" "$STR_PLIST_FILEPATH"
    fi
  else
/usr/libexec/PlistBuddy -c "Add:LaunchCount integer 0" "$STR_PLIST_FILEPATH"
  fi
  #####
STR_VALUE=$(/usr/libexec/PlistBuddy -c "Print:filenameEncoding" "$STR_PLIST_FILEPATH")
  if [ $? -eq 0 ]; then
    if [ "$STR_VALUE" -ne 8 ]; then
/usr/libexec/PlistBuddy -c "Set:filenameEncoding 8" "$STR_PLIST_FILEPATH"
    fi
  else
/usr/libexec/PlistBuddy -c "Add:filenameEncoding integer 8" "$STR_PLIST_FILEPATH"
  fi
  #####
STR_VALUE=$(/usr/libexec/PlistBuddy -c "Print:TUConfigInformationBannerViewedCount" "$STR_PLIST_FILEPATH")
  if [ $? -eq 0 ]; then
    if [ "$STR_VALUE" -ne 0 ]; then
/usr/libexec/PlistBuddy -c "Set:TUConfigInformationBannerViewedCount 0" "$STR_PLIST_FILEPATH"
    fi
  else
/usr/libexec/PlistBuddy -c "Add:TUConfigInformationBannerViewedCount integer 0" "$STR_PLIST_FILEPATH"
  fi
  #####
STR_VALUE=$(/usr/libexec/PlistBuddy -c "Print:OnboardingUserViewedWelcomeSlide" "$STR_PLIST_FILEPATH")
  if [ $? -eq 0 ]; then
    if [ "$STR_VALUE" != "true" ]; then
/usr/libexec/PlistBuddy -c "Set:OnboardingUserViewedWelcomeSlide true" "$STR_PLIST_FILEPATH"
    fi
  else
/usr/libexec/PlistBuddy -c "Add:OnboardingUserViewedWelcomeSlide bool true" "$STR_PLIST_FILEPATH"
  fi
  #####
STR_VALUE=$(/usr/libexec/PlistBuddy -c "Print:SUEnableAutomaticChecks" "$STR_PLIST_FILEPATH")
  if [ $? -eq 0 ]; then
    if [ "$STR_VALUE" != "true" ]; then
/usr/libexec/PlistBuddy -c "Set:SUEnableAutomaticChecks true" "$STR_PLIST_FILEPATH"
    fi
  else
/usr/libexec/PlistBuddy -c "Add:SUEnableAutomaticChecks bool true" "$STR_PLIST_FILEPATH"
  fi
  #####
STR_VALUE=$(/usr/libexec/PlistBuddy -c "Print:userAgreedToNewTOSAndPrivacy" "$STR_PLIST_FILEPATH")
  if [ $? -eq 0 ]; then
    if [ "$STR_VALUE" != "true" ]; then
/usr/libexec/PlistBuddy -c "Set:userAgreedToNewTOSAndPrivacy true" "$STR_PLIST_FILEPATH"
    fi
  else
/usr/libexec/PlistBuddy -c "Add:userAgreedToNewTOSAndPrivacy bool true" "$STR_PLIST_FILEPATH"
  fi
  #####
STR_VALUE=$(/usr/libexec/PlistBuddy -c "Print:isFreshInstall" "$STR_PLIST_FILEPATH")
  if [ $? -eq 0 ]; then
    if [ "$STR_VALUE" != "true" ]; then
/usr/libexec/PlistBuddy -c "Set:isFreshInstall true" "$STR_PLIST_FILEPATH"
    fi
  else
/usr/libexec/PlistBuddy -c "Add:isFreshInstall bool true" "$STR_PLIST_FILEPATH"
  fi
  #####
STR_VALUE=$(/usr/libexec/PlistBuddy -c "Print:TUConfigInformationBannerOpened" "$STR_PLIST_FILEPATH")
  if [ $? -eq 0 ]; then
    if [ "$STR_VALUE" != "true" ]; then
/usr/libexec/PlistBuddy -c "Set:TUConfigInformationBannerOpened true" "$STR_PLIST_FILEPATH"
    fi
  else
/usr/libexec/PlistBuddy -c "Add:TUConfigInformationBannerOpened bool true" "$STR_PLIST_FILEPATH"
  fi
  #####
STR_VALUE=$(/usr/libexec/PlistBuddy -c "Print:deleteExtractedArchive" "$STR_PLIST_FILEPATH")
  if [ $? -eq 0 ]; then
    if [ "$STR_VALUE" != "true" ]; then
/usr/libexec/PlistBuddy -c "Set:deleteExtractedArchive true" "$STR_PLIST_FILEPATH"
    fi
  else
/usr/libexec/PlistBuddy -c "Add:deleteExtractedArchive bool true" "$STR_PLIST_FILEPATH"
  fi
  #####
STR_VALUE=$(/usr/libexec/PlistBuddy -c "Print:autoupdatesEnabled" "$STR_PLIST_FILEPATH")
  if [ $? -eq 0 ]; then
    if [ "$STR_VALUE" != "false" ]; then
/usr/libexec/PlistBuddy -c "Set:autoupdatesEnabled false" "$STR_PLIST_FILEPATH"
    fi
  else
/usr/libexec/PlistBuddy -c "Add:autoupdatesEnabled bool false" "$STR_PLIST_FILEPATH"
  fi


###
/usr/libexec/PlistBuddy -c "Save" "$STR_PLIST_FILEPATH"
done

sleep 1

"/usr/bin/killall" cfprefsd

/bin/echo "処理:設定終了"
exit 0


|

[PlistBuddy]bash zsh設定


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

#!/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 appFileManager to refMe's NSFileManager's defaultManager()
set ocidUserName to refMe's NSUserName()
set ocidHomeDirURL to appFileManager's homeDirectoryForUser:(ocidUserName)

set listFileName to {".zshrc", ".zprofile", ".bashrc", ".bash_profile"} as list


########################################
##本処理
repeat with itemFileName in listFileName
  set strFileName to itemFileName as text
  set ocidFilePathURL to (ocidHomeDirURL's URLByAppendingPathComponent:(strFileName))
  ###テキストに読み込んで
  set listReadString to (refMe's NSString's stringWithContentsOfURL:(ocidFilePathURL) encoding:(refMe's NSUTF8StringEncoding) |error|:(reference))
  set ocidReadString to (item 1 of listReadString)
  if ocidReadString = (missing value) then
    log "対象ファイルが見つかりません"
  else
    ###改行でArrayni
    set ocidReadArray to (ocidReadString's componentsSeparatedByString:("\n"))
    set boolExist to false
    repeat with itemReadLine in ocidReadArray
    ### PlistBuddy行があるか?チェック
      if (itemReadLine as text) starts with "alias PlistBuddy" then
set boolExist to true
exit repeat
      end if
    end repeat
    if boolExist is true then
      log "すでに登録済みです"
    else
      set ocidOutPutStrings to (ocidReadString's stringByAppendingString:("\nalias PlistBuddy='/usr/libexec/PlistBuddy'\n"))
      set listDone to (ocidOutPutStrings's writeToURL:(ocidFilePathURL) atomically:(true) encoding:(refMe's NSUTF8StringEncoding) |error|:(reference))
      log item 1 of listDone
      set strCommandText to ("source ~/" & strFileName & "") as text
      do shell script strCommandText
    end if
  end if
  
end repeat


return


|

[PlistBuddy]キー名称にスペースがある場合


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


##シングルクオトで囲む
/usr/libexec/PlistBuddy -c "Print:SystemPowerSettings:'Update DarkWakeBG Setting'" /Library/Preferences/com.apple.PowerManagement.plist
##スペースをエスケープするか
/usr/libexec/PlistBuddy -c "Print:SystemPowerSettings:Update\ DarkWakeBG\ Setting" /Library/Preferences/com.apple.PowerManagement.plist



|

[PlistBuddy]Dockにフォルダを追加する

サンプルはこの位置=『:persistent-apps:0』=最初 にデスクトップを追加
Screencapture-20230626-181726
内容的には
Screencapture-20230626-182333
こんな感じ

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

#!/bin/bash
#com.cocolog-nifty.quicktimer.icefloe
########################
###Arrayに新規ArrayでDictを追加
/usr/libexec/PlistBuddy -c "add:persistent-apps:0 dict" "$HOME/Library/Preferences/com.apple.dock.plist"
###↑ここで追加したDictにキーと値を入れていく
/usr/libexec/PlistBuddy -c "add:persistent-apps:0:GUID integer $RANDOM$RANDOM" "$HOME/Library/Preferences/com.apple.dock.plist"
/usr/libexec/PlistBuddy -c "add:persistent-apps:0:tile-type string directory-tile" "$HOME/Library/Preferences/com.apple.dock.plist"
###↑この親Dictに子要素としてtile-dataをDictで追加
/usr/libexec/PlistBuddy -c "add:persistent-apps:0:tile-data dict" "$HOME/Library/Preferences/com.apple.dock.plist"
###↑子要素のtile-dataにキーと値を入れていく
/usr/libexec/PlistBuddy -c "add:persistent-apps:0:tile-data:showas integer 0" "$HOME/Library/Preferences/com.apple.dock.plist"
/usr/libexec/PlistBuddy -c "add:persistent-apps:0:tile-data:file-type integer 2" "$HOME/Library/Preferences/com.apple.dock.plist"
/usr/libexec/PlistBuddy -c "add:persistent-apps:0:tile-data:displayas integer 0" "$HOME/Library/Preferences/com.apple.dock.plist"
/usr/libexec/PlistBuddy -c "add:persistent-apps:0:tile-data:parent-mod-date integer $(date '+%s')" "$HOME/Library/Preferences/com.apple.dock.plist"
/usr/libexec/PlistBuddy -c "add:persistent-apps:0:tile-data:file-mod-date integer $(date '+%s')" "$HOME/Library/Preferences/com.apple.dock.plist"
/usr/libexec/PlistBuddy -c "add:persistent-apps:0:tile-data:file-label string Desktop" "$HOME/Library/Preferences/com.apple.dock.plist"
/usr/libexec/PlistBuddy -c "add:persistent-apps:0:tile-data:is-beta bool false" "$HOME/Library/Preferences/com.apple.dock.plist"
###↑この子要素のtile-dataに孫要素でfile-dataをDictで追加
/usr/libexec/PlistBuddy -c "add:persistent-apps:0:tile-data:file-data dict" "$HOME/Library/Preferences/com.apple.dock.plist"
###値を入れていく
/usr/libexec/PlistBuddy -c "add:persistent-apps:0:tile-data:file-data:_CFURLStringType integer 15" "$HOME/Library/Preferences/com.apple.dock.plist"
/usr/libexec/PlistBuddy -c "add:persistent-apps:0:tile-data:file-data:_CFURLString string file://$HOME/Desktop" "$HOME/Library/Preferences/com.apple.dock.plist"
###Dock再起動
/usr/bin/killall Dock

|

[PlistBuddy]処理の流れ


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

###警告出すようにする
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:WarnOnEmptyTrash\" \"$HOME/Library/Preferences/com.apple.finder.plist\"") as text
set strBoolWarns to (do shell script strCommandText) as text
if strBoolWarns is "false" then
  ##値の変更 BOOL
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:WarnOnEmptyTrash bool true\" \"$HOME/Library/Preferences/com.apple.finder.plist\"") as text
  do shell script strCommandText
  ##確認
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:WarnOnEmptyTrash\" \"$HOME/Library/Preferences/com.apple.finder.plist\"") as text
  do shell script strCommandText
  ##保存
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Save\" \"$HOME/Library/Preferences/com.apple.finder.plist\"") as text
  do shell script strCommandText
end if



####初期設定までのパス
tell application "Finder"
  set aliasPreferencesDirPath to (path to library folder from user domain) as alias
end tell
set strFilePath to (POSIX path of aliasPreferencesDirPath) as text
set strFilePath to (strFilePath & "Containers/com.apple.archiveutility/Data/Library/Preferences/com.apple.archiveutility.plist")
####まずはKey値があるか?を確認する
try
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:dearchive-into\"  \"" & strFilePath & "\"") as text
  set strResponseArray to (do shell script strCommandText) as text
  ###Key値があれば変更する
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:dearchive-into '.'\"  \"" & strFilePath & "\"") as text
  do shell script strCommandText
on error
  ###Key値がなければ作る
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:dearchive-into string '.'\"  \"" & strFilePath & "\"") as text
  do shell script strCommandText
end try

###保存する
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Save\"  \"" & strFilePath & "\"") as text
do shell script strCommandText


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

#!/bin/bash
#com.cocolog-nifty.quicktimer.icefloe
#################################################
##コマンド
/usr/libexec/PlistBuddy -h
#→ヘルプ
/usr/libexec/PlistBuddy -c
#→コマンド形式(1ライナー用)
/usr/libexec/PlistBuddy -x
#→インタラクティブな応答形式
#################################################
##オプション
/usr/libexec/PlistBuddy -c "Print:"
/usr/libexec/PlistBuddy -c "Set:"
/usr/libexec/PlistBuddy -c "Add:"
/usr/libexec/PlistBuddy -c "Delete:"
/usr/libexec/PlistBuddy -c "Revert:"
/usr/libexec/PlistBuddy -c "Save:"
/usr/libexec/PlistBuddy -c "Clear:"
/usr/libexec/PlistBuddy -c "Copy:"
/usr/libexec/PlistBuddy -c "Merge:"
/usr/libexec/PlistBuddy -c "Import:"
#################################################
##新規作成
/usr/libexec/PlistBuddy -c "Save:" "$HOME/Desktop/サンプルA.plist"
##内容表示
/usr/libexec/PlistBuddy -c "Print:" "$HOME/Desktop/サンプルA.plist"
Dict {
}
##################
##値を入れる KEY=AAAA VALUE=9999
/usr/libexec/PlistBuddy -c "Add:AAAA integer 9999 " "$HOME/Desktop/サンプルA.plist"
##内容表示
/usr/libexec/PlistBuddy -c "Print:" "$HOME/Desktop/サンプルA.plist"
Dict {
    AAAA = 9999
}
##値を入れる KEY=AAAA VALUE=2222
/usr/libexec/PlistBuddy -c "Set:AAAA 2222 " "$HOME/Desktop/サンプルA.plist"
/usr/libexec/PlistBuddy -c "Print:" "$HOME/Desktop/サンプルA.plist"
Dict {
    AAAA = 2222
}
##############
##値を入れる KEY=BBBB VALUE=false
/usr/libexec/PlistBuddy -c "Add:BBBB bool false" "$HOME/Desktop/サンプルA.plist"
##値を入れる KEY=CCCC VALUE=false
/usr/libexec/PlistBuddy -c "Add:CCCC bool false" "$HOME/Desktop/サンプルA.plist"
##値を入れる KEY=DDDD VALUE=false
/usr/libexec/PlistBuddy -c "Add:DDDD bool 0" "$HOME/Desktop/サンプルA.plist"
##値を入れる KEY=EEEE VALUE=false
/usr/libexec/PlistBuddy -c "Add:EEEE bool 0" "$HOME/Desktop/サンプルA.plist"
##内容表示
/usr/libexec/PlistBuddy -c "Print:" "$HOME/Desktop/サンプルA.plist"
Dict {
    CCCC = false
    BBBB = false
    EEEE = false
    DDDD = false
}
##############
##↑の操作で値はBOOL値であることが指定されているので変更時には不要
##値を入れる KEY=BBBB VALUE=true
/usr/libexec/PlistBuddy -c "Set:BBBB true" "$HOME/Desktop/サンプルA.plist"
##値を入れる KEY=CCCC VALUE=true
/usr/libexec/PlistBuddy -c "SET:CCCC true" "$HOME/Desktop/サンプルA.plist"
##値を入れる KEY=DDDD VALUE=true
/usr/libexec/PlistBuddy -c "SET:DDDD 1" "$HOME/Desktop/サンプルA.plist"
##値を入れる KEY=EEEE VALUE=true
/usr/libexec/PlistBuddy -c "SET:EEEE 1" "$HOME/Desktop/サンプルA.plist"
##内容表示
/usr/libexec/PlistBuddy -c "Print:" "$HOME/Desktop/サンプルA.plist"
Dict {
    CCCC = true
    BBBB = true
    EEEE = true
    DDDD = true
}
exit 0


|

[applescript]CDとDVD

Screencapture-20230518-20806

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

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

###イジェクトメニュー有効化
set strFilePath to ("/System/Library/CoreServices/Menu Extras/Eject.menu") as text
tell application "Finder"
  set aliasFilePath to POSIX file strFilePath as alias
  open aliasFilePath
end tell


######################################################
tell application "Finder"
  set aliasPreferencesDirPath to (path to preferences folder from user domain) as alias
  set strFileName to "com.apple.systemuiserver.plist" as text
  set aliasFilePath to (file strFileName of folder aliasPreferencesDirPath) as alias
end tell
set strFilePath to (POSIX path of aliasFilePath) as text
###すでに設定済みか?チェック 項目名にスペースがある場合はシングルクオトに入れる
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:'NSStatusItem Visible com.apple.menuextra.eject'\" \"" & strFilePath & "\"") as text
try
  set boolChk to (do shell script strCommandText) as boolean
on error
  ##エラーしたら項目が無いって事なので判定用のあたいを入れておく
  set boolChk to false as boolean
end try
###設定されていなければ設定する
if boolChk is not true then
  set strBoolNo to "1" as text
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:'NSStatusItem Visible com.apple.menuextra.eject' bool true\"  \"" & strFilePath & "\"") as text
  log strCommandText
  do shell script strCommandText
end if


######################################################
tell application "Finder"
  set aliasPreferencesDirPath to (path to preferences folder from user domain) as alias
  set strFileName to "com.apple.systemuiserver.plist" as text
  set aliasFilePath to (file strFileName of folder aliasPreferencesDirPath) as alias
end tell
set strFilePath to (POSIX path of aliasFilePath) as text
###すでに設定済みか?チェック
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:menuExtras:\"  \"" & strFilePath & "\"") as text
try
  set strResponseArray to (do shell script strCommandText) as text
on error
  ##エラーしたら項目が無いって事なので判定用のあたいを入れておく
  set strResponseArray to "Eject.menu" as text
end try
###設定されていなければ設定する (Array形式なのでADDする)
if strResponseArray does not contain "Eject.menu" then
  set strMenuExtras to "/System/Library/CoreServices/Menu Extras/Eject.menu" as text
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"add:menuExtras:0 string '" & strMenuExtras & "'\"  \"" & strFilePath & "\"") as text
  log strCommandText
  do shell script strCommandText
end if


######################################################
tell application "Finder"
  set aliasPreferencesDirPath to (path to preferences folder from user domain) as alias
  set strFileName to "com.apple.digihub.plist" as text
  set aliasFilePath to (file strFileName of folder aliasPreferencesDirPath) as alias
end tell
set strFilePath to (POSIX path of aliasFilePath) as text
###設定内容チェック
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:com.apple.digihub.blank.cd.appeared:action\"  \"" & strFilePath & "\"") as text
log strCommandText
try
  set numResponse to (do shell script strCommandText) as text
on error
  set numResponse to "0" as text
  ###DICTを作って
  try
    set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:com.apple.digihub.blank.cd.appeared dict\"  \"" & strFilePath & "\"") as text
    do shell script strCommandText
  end try
  ###値のタイプを確定(この場合はinteger)
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:com.apple.digihub.blank.cd.appeared:action integer\"  \"" & strFilePath & "\"") as text
  do shell script strCommandText
end try
if numResponse is not "100" then
  ###値を入れる
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:com.apple.digihub.blank.cd.appeared:action 100\"  \"" & strFilePath & "\"") as text
  do shell script strCommandText
end if




######################################################
tell application "Finder"
  set aliasPreferencesDirPath to (path to preferences folder from user domain) as alias
  set strFileName to "com.apple.digihub.plist" as text
  set aliasFilePath to (file strFileName of folder aliasPreferencesDirPath) as alias
end tell
set strFilePath to (POSIX path of aliasFilePath) as text
###設定内容チェック
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:com.apple.digihub.blank.dvd.appeared:action\"  \"" & strFilePath & "\"") as text
log strCommandText
try
  set numResponse to (do shell script strCommandText) as text
on error
  set numResponse to "0" as text
  ###DICTを作って
  try
    set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:com.apple.digihub.blank.dvd.appeared dict\"  \"" & strFilePath & "\"") as text
    do shell script strCommandText
  end try
  ###値のタイプを確定(この場合はinteger)
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:com.apple.digihub.blank.dvd.appeared:action integer\"  \"" & strFilePath & "\"") as text
  do shell script strCommandText
end try
if numResponse is not "100" then
  ###値を入れる
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:com.apple.digihub.blank.dvd.appeared:action 100\"  \"" & strFilePath & "\"") as text
  do shell script strCommandText
end if


######################################################
tell application "Finder"
  set aliasPreferencesDirPath to (path to preferences folder from user domain) as alias
  set strFileName to "com.apple.digihub.plist" as text
  set aliasFilePath to (file strFileName of folder aliasPreferencesDirPath) as alias
end tell
set strFilePath to (POSIX path of aliasFilePath) as text
###設定内容チェック
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:com.apple.digihub.cd.music.appeared:action\"  \"" & strFilePath & "\"") as text
log strCommandText
try
  set numResponse to (do shell script strCommandText) as text
on error
  set numResponse to "0" as text
  ###DICTを作って
  try
    set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:com.apple.digihub.cd.music.appeared dict\"  \"" & strFilePath & "\"") as text
    do shell script strCommandText
  end try
  ###値のタイプを確定(この場合はinteger)
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:com.apple.digihub.cd.music.appeared:action integer\"  \"" & strFilePath & "\"") as text
  do shell script strCommandText
end try
if numResponse is not "1" then
  ###値を入れる
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:com.apple.digihub.cd.music.appeared:action 1\"  \"" & strFilePath & "\"") as text
  do shell script strCommandText
end if



######################################################
tell application "Finder"
  set aliasPreferencesDirPath to (path to preferences folder from user domain) as alias
  set strFileName to "com.apple.digihub.plist" as text
  set aliasFilePath to (file strFileName of folder aliasPreferencesDirPath) as alias
end tell
set strFilePath to (POSIX path of aliasFilePath) as text
###設定内容チェック
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:com.apple.digihub.cd.picture.appeared:action\"  \"" & strFilePath & "\"") as text
log strCommandText
try
  set numResponse to (do shell script strCommandText) as text
on error
  set numResponse to "0" as text
  ###DICTを作って
  try
    set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:com.apple.digihub.cd.picture.appeared dict\"  \"" & strFilePath & "\"") as text
    do shell script strCommandText
  end try
  ###値のタイプを確定(この場合はinteger)
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:com.apple.digihub.cd.picture.appeared:action integer\"  \"" & strFilePath & "\"") as text
  do shell script strCommandText
end try
if numResponse is not "1" then
  ###値を入れる
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:com.apple.digihub.cd.picture.appeared:action 1\"  \"" & strFilePath & "\"") as text
  do shell script strCommandText
end if

######################################################
tell application "Finder"
  set aliasPreferencesDirPath to (path to preferences folder from user domain) as alias
  set strFileName to "com.apple.digihub.plist" as text
  set aliasFilePath to (file strFileName of folder aliasPreferencesDirPath) as alias
end tell
set strFilePath to (POSIX path of aliasFilePath) as text
###設定内容チェック
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Print:com.apple.digihub.dvd.video.appeared:action\"  \"" & strFilePath & "\"") as text
log strCommandText
try
  set numResponse to (do shell script strCommandText) as text
on error
  set numResponse to "0" as text
  ###DICTを作って
  try
    set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:com.apple.digihub.dvd.video.appeared dict\"  \"" & strFilePath & "\"") as text
    do shell script strCommandText
  end try
  ###値のタイプを確定(この場合はinteger)
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Add:com.apple.digihub.dvd.video.appeared:action integer\"  \"" & strFilePath & "\"") as text
  do shell script strCommandText
end try
if numResponse is not "1" then
  ###値を入れる
  set strCommandText to ("/usr/libexec/PlistBuddy -c \"Set:com.apple.digihub.dvd.video.appeared:action 1\"  \"" & strFilePath & "\"") as text
  do shell script strCommandText
end if


##最後に保存
set strCommandText to ("/usr/libexec/PlistBuddy -c \"Save\"  \"" & strFilePath & "\"") as text
do shell script strCommandText




|

[PlistBuddy] /usr/libexec/PlistBuddy -c Import

データ形式で設定したい場合に主に利用します



ダウンロード - plistimport.zip




#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
(*
こちらのURL
https://adobe.ly/3qqoq8p
Acrobat または Reader にてデフォルトで手のひらツールを利用したい場合についてこちらの記事の Macの場合の対処方法
値はDATAなので以下 <48616E6400>
詳しくはこちら
https://force4u.cocolog-nifty.com/skywalker/2022/09/post-d635db.html

*)
#
#
# 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

######ログ表示
doLogView()

property objMe : a reference to current application
property objNSString : a reference to objMe's NSString
property objNSMutableString : a reference to objMe's NSMutableString
property objNSURL : a reference to objMe's NSURL

property objNSNotFound : a reference to 9.22337203685477E+18 + 5807

set objFileManager to objMe's NSFileManager's defaultManager()


tell application "Finder"
###このファイルのエイリアス
set aliasMe to path to me as alias
log aliasMe as alias
end tell
### UNIXパスに
set strMePath to POSIX path of aliasMe as text
log strMePath as text

### パスをNSString
set ocidMePathString to objNSString's stringWithString:strMePath
log ocidMePathString as text
log className() of ocidMePathString as text

### NSString NSURL
set ocidMePathNSURL to objNSURL's fileURLWithPath:ocidMePathString
log ocidMePathNSURL as text
log className() of ocidMePathNSURL as text

### このファイルがあるディレクトリ
set ocidMePathContainer to ocidMePathNSURL's URLByDeletingLastPathComponent
log ocidMePathContainer as text
log className() of ocidMePathContainer as text

### インポートするデータのパス
set ocidImportDataPath to ocidMePathContainer's URLByAppendingPathComponent:"ImportData/Hand.bin"
log ocidImportDataPath as text
log className() of ocidImportDataPath as text

###インポートするファイルのUNIXパス
set strImportDataPath to ocidImportDataPath's |path|() as text

############################################
#### ユーザーLibraryパス取得
set ocidUserLibraryPath to (objFileManager's URLsForDirectory:(objMe's NSLibraryDirectory) inDomains:(objMe's NSUserDomainMask))
log ocidUserLibraryPath as text
log className() of ocidUserLibraryPath as text

###Arrayで入るのでパスURLを取り出す
set ocidNsurlLibraryPath to ocidUserLibraryPath's objectAtIndex:0
log ocidNsurlLibraryPath as text
log className() of ocidNsurlLibraryPath as text

#### コンポーネント追加
set ocidPreferencesPath to ocidNsurlLibraryPath's URLByAppendingPathComponent:"Preferences"
log ocidPreferencesPath as text
log className() of ocidPreferencesPath as text

#### コンポーネント追加
set ocidAcrobatReaderPlistPath to ocidPreferencesPath's URLByAppendingPathComponent:"com.adobe.Reader.plist"
log ocidAcrobatReaderPlistPath as text
log className() of ocidAcrobatReaderPlistPath as text

#### コンポーネント追加
set ocidAcrobatProPlistPath to ocidPreferencesPath's URLByAppendingPathComponent:"com.adobe.Acrobat.Pro.plist"
log ocidAcrobatProPlistPath as text
log className() of ocidAcrobatProPlistPath as text

####UNIXパス
set strAcrobatProPlistPath to ocidAcrobatProPlistPath's |path|() as text
set strAcrobatReaderPlistPath to ocidAcrobatReaderPlistPath's |path|() as text
log strAcrobatProPlistPath as text
log strAcrobatReaderPlistPath as text

####ファイルの有無 Pro
set boolChkAcrobatProPlistPath to (ocidAcrobatProPlistPath's checkResourceIsReachableAndReturnError:(missing value))
log boolChkAcrobatProPlistPath as boolean
####ファイルの有無 Reader
set boolChkAcrobatReaderPlistPath to (ocidAcrobatReaderPlistPath's checkResourceIsReachableAndReturnError:(missing value))
log boolChkAcrobatReaderPlistPath as boolean

if boolChkAcrobatProPlistPath is true then
try
###まずは 今の値を読み取ります
set strCommandText to "/usr/libexec/PlistBuddy -c \"Print :DC:Selection:DefaultSelect:1\" \"" & strAcrobatProPlistPath & "\""
set strCommandResult to (do shell script strCommandText) as text
log strCommandResult
on error
log "設定項目が見つかりません"
set strCommandResult to ""
end try
if strCommandResult contains "Hand" then
set strCommandResult to ""
log "設定済みです"
else
set strCommandResult to ""
try
###今ある値を削除して
set strCommandText to "/usr/libexec/PlistBuddy -c \"Delete :DC:Selection:DefaultSelect:1\" \"" & strAcrobatProPlistPath & "\""
do shell script strCommandText
end try
delay 1
####値をインポートします
set strCommandText to "/usr/libexec/PlistBuddy -c \"Import :DC:Selection:DefaultSelect:1 '" & strImportDataPath & "'\" '" & strAcrobatProPlistPath & "'"
do shell script strCommandText
delay 1
####正しくインポート出来たか?確認
set strCommandText to "/usr/libexec/PlistBuddy -c \"Print :DC:Selection:DefaultSelect:1\" \"" & strAcrobatProPlistPath & "\""
set strCommandResult to (do shell script strCommandText) as text
if strCommandResult contains "Hand" then
log "設定完了"
else
log "設定に失敗しました"
end if
set strCommandResult to ""
end if
end if



if boolChkAcrobatReaderPlistPath is true then
try
###まずは 今の値を読み取ります
set strCommandText to "/usr/libexec/PlistBuddy -c \"Print :DC:Selection:DefaultSelect:1\" \"" & strAcrobatReaderPlistPath & "\""
set strCommandResult to (do shell script strCommandText) as text
log strCommandResult
on error
log "設定項目が見つかりません"
set strCommandResult to ""
end try
if strCommandResult contains "Hand" then
log "設定済みです"
else
set strCommandResult to ""
try
###今ある値を削除して
set strCommandText to "/usr/libexec/PlistBuddy -c \"Delete :DC:Selection:DefaultSelect:1\" \"" & strAcrobatReaderPlistPath & "\""
do shell script strCommandText
end try
delay 1
####値をインポートします
set strCommandText to "/usr/libexec/PlistBuddy -c \"Import :DC:Selection:DefaultSelect:1 '" & strImportDataPath & "'\" '" & strAcrobatReaderPlistPath & "'"
do shell script strCommandText
delay 1
####正しくインポート出来たか?確認
set strCommandText to "/usr/libexec/PlistBuddy -c \"Print :DC:Selection:DefaultSelect:1\" \"" & strAcrobatReaderPlistPath & "\""
set strCommandResult to (do shell script strCommandText) as text
if strCommandResult contains "Hand" then
log "設定完了"
else
log "設定に失敗しました"
end if
set strCommandResult to ""
end if
end if


############################################



#########################ログ表示
to doLogView()

tell application "System Events"
set listAppList to title of (every process where background only is false)
end tell
repeat with objAppList in listAppList
set strAppList to objAppList as text
if strAppList is "スクリプトエディタ" then
tell application "Script Editor"
if frontmost is true then
try
tell application "System Events" to click menu item "ログを表示" of menu "表示" of menu bar item "表示" of menu bar 1 of application process "Script Editor"
end try
end if
end tell
end if
end repeat

end doLogView
#########################

|

PlistBuddyを使ってみよう(その6:データ)

各種データを追加してみましょう
string
bool
integer
real
date



string文字列です

/usr/libexec/PlistBuddy -c "add:GGG string 美しい日本語" $HOME/Desktop/PlistBuddy.plist

20220301-195002

エスケープが必要な文字列の場合は
/usr/libexec/PlistBuddy -c "add:JJJ string \\\"美しい日本語\\\"" $HOME/Desktop/PlistBuddy.plist
トリプルになりますので留意してください。



bool 可不可 YES NO (内部的には1=True 0=False
/usr/libexec/PlistBuddy -c "add:CCC bool true" $HOME/Desktop/PlistBuddy.plist
sh-3.2$ /usr/libexec/PlistBuddy -c "add:DDD bool false" $HOME/Desktop/PlistBuddy.plist

20220301-195235



integer 整数
/usr/libexec/PlistBuddy -c "add:FFF integer 3.14" $HOME/Desktop/PlistBuddy.plist
小数点以下は切り捨てられます
20220301-195414



real 数値
/usr/libexec/PlistBuddy -c "add:EEE real 3.14" $HOME/Desktop/PlistBuddy.plist

20220301-195745



date 日付
/usr/libexec/PlistBuddy -c "add:KKK date Tue Mar 1 17:12:21 JST 2022" $HOME/Desktop/PlistBuddy.plist

このPlistBuddyで使う日付フォーマットは以下の手順にて取得できます。
export LANG=C
date

sh-3.2$ 

sh-3.2$ export LANG=C

sh-3.2$ 

sh-3.2$ date

Tue Mar  1 20:01:18 JST 2022

sh-3.2$ 

20220301-200318

|

その他のカテゴリー

Acrobat Acrobat 2020 Acrobat AddOn Acrobat Annotation Acrobat AV2 Acrobat BookMark Acrobat Classic Acrobat DC Acrobat Dialog Acrobat Distiller Acrobat Form Acrobat JS Acrobat Manifest Acrobat Menu Acrobat Open Acrobat Plugin Acrobat Preferences Acrobat Preflight Acrobat python Acrobat Reader Acrobat SCA Acrobat SCA Updater Acrobat Sequ Acrobat Sign Acrobat Stamps Acrobat Watermark Acrobat Windows Admin Admin Account Admin Apachectl Admin configCode Admin Device Management Admin LaunchServices Admin Locationd Admin loginitem Admin Maintenance Admin Mobileconfig Admin Permission Admin Pkg Admin Power Management Admin Printer Admin SetUp Admin SMB Admin Support Admin System Information Admin Tools Admin Users Admin Volumes Adobe Adobe FDKO Adobe RemoteUpdateManager Apple AppleScript AppleScript Accessibility AppleScript AppKit AppleScript Applications AppleScript AppStore AppleScript Archive AppleScript Attributes AppleScript Audio 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 Diff AppleScript Disk AppleScript do shell script AppleScript Dock AppleScript DropBox AppleScript Droplet AppleScript eMail AppleScript Encode % AppleScript Encode Decode AppleScript Encode UTF8 AppleScript Error AppleScript EXIFData AppleScript ffmpeg AppleScript File AppleScript Finder AppleScript Firefox AppleScript Folder AppleScript Fonts AppleScript GIF AppleScript Guide AppleScript HTML AppleScript HTML Entity AppleScript Icon AppleScript Illustrator AppleScript Image Events AppleScript Image2PDF AppleScript ImageOptim AppleScript iWork AppleScript Javascript AppleScript Jedit AppleScript Json AppleScript Label AppleScript Leading Zero AppleScript List AppleScript locationd AppleScript LRC AppleScript LSSharedFileList AppleScript m3u8 AppleScript Mail AppleScript MakePDF AppleScript Map AppleScript Math AppleScript Messages AppleScript Microsoft AppleScript Microsoft Edge AppleScript Microsoft Excel AppleScript Mouse AppleScript Movie AppleScript Music AppleScript NetWork AppleScript Notes AppleScript NSArray AppleScript NSArray Sort 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 NSFileManager enumeratorAtURL AppleScript NSFont AppleScript NSFontManager AppleScript NSGraphicsContext 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 NSpoint AppleScript NSPredicate AppleScript NSPrintOperation AppleScript NSRange AppleScript NSRect 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 NSURLSession AppleScript NSUserDefaults AppleScript NSUUID AppleScript NSView AppleScript NSWorkspace AppleScript Numbers AppleScript OAuth AppleScript ObjC AppleScript OneDrive AppleScript Osax AppleScript PDF AppleScript PDFAnnotation AppleScript PDFAnnotationWidget AppleScript PDFContext AppleScript PDFDisplayBox AppleScript PDFDocumentPermissions AppleScript PDFImageRep AppleScript PDFKit AppleScript PDFnUP AppleScript PDFOutline AppleScript Photoshop AppleScript Pictures 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 Sound AppleScript Spotlight AppleScript SRT AppleScript StandardAdditions AppleScript stringByApplyingTransform AppleScript Swift AppleScript System Events AppleScript System Events Plist AppleScript System Settings AppleScript TemporaryItems AppleScript Terminal AppleScript Text AppleScript Text CSV AppleScript Text MD 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 savedSearch AppleScript XML SVG AppleScript XML TTML AppleScript XML webloc AppleScript XMP AppleScript YouTube Applications CityCode github iPhone List lsappinfo Memo Music perl PlistBuddy pluginkit postalcode ReadMe SF Symbols character id SF Symbols Entity sips Skype Slack sqlite TCC Tools Typography Video Wacom Windows zoom