AppleScript Archive

[圧縮解凍ソフト]KEKAインストール(bash)


サンプルコード

サンプルソース(参考)
行番号ソース
001#!/bin/bash
002#com.cocolog-nifty.quicktimer.icefloe
003#################################################
004###管理者インストールしているか?チェック
005USER_WHOAMI=$(/usr/bin/whoami)
006/bin/echo "実行ユーザー(whoami): $USER_WHOAMI"
007###実行しているユーザー名
008CONSOLE_USER=$(/bin/echo "show State:/Users/ConsoleUser" | /usr/sbin/scutil | /usr/bin/awk '/Name :/ { print $3 }')
009/bin/echo "コンソールユーザー(scutil): $CONSOLE_USER"
010###実行しているユーザー名
011HOME_USER=$(/bin/echo "$HOME" | /usr/bin/awk -F'/' '{print $NF}')
012/bin/echo "実行ユーザー(HOME): $HOME_USER"
013###logname
014LOGIN_NAME=$(/usr/bin/logname)
015/bin/echo "ログイン名(logname): $LOGIN_NAME"
016###UID
017USER_NAME=$(/usr/bin/id -un)
018/bin/echo "ユーザー名(id): $USER_NAME"
019###STAT
020STAT_USR=$(/usr/bin/stat -f%Su /dev/console)
021/bin/echo "STAT_USR(console): $STAT_USR"
022#################################################
023###ダウンロード起動時に削除する項目
024USER_TEMP_DIR=$(/usr/bin/mktemp -d)
025/bin/echo "起動時に削除されるディレクトリ:" "$USER_TEMP_DIR"
026###ダウンロードURL
027STR_URL="https://d.keka.io/"
028STR_LOCATION=$(/usr/bin/curl -s -L -o /dev/null -D - "$STR_URL" | grep "location" | grep "download" | awk '{print $2}' | tr -d '\n')
029/bin/echo "STR_LOCATION: $STR_LOCATION"
030###ファイル名を取得
031DL_FILE_NAME=$(/usr/bin/curl -s -L -o /dev/null -w '%{url_effective}' "$STR_LOCATION" | /usr/bin/rev | /usr/bin/cut -d'/' -f1 | /usr/bin/rev)
032/bin/echo "DL_FILE_NAME: $DL_FILE_NAME"
033###ダウンロード
034if ! /usr/bin/curl -L -o "$USER_TEMP_DIR/$DL_FILE_NAME" "$STR_URL" --connect-timeout 20; then
035  /bin/echo "ファイルのダウンロードに失敗しました HTTP1.1で再トライします"
036  if ! /usr/bin/curl -L -o "$USER_TEMP_DIR/$DL_FILE_NAME" "$STR_URL" --http1.1 --connect-timeout 20; then
037    /bin/echo "ファイルのダウンロードに失敗しました"
038    exit 1
039  fi
040fi
041#################################################
042STR_BUNDLEID="com.aone.keka"
043###終了させて
044/usr/bin/osascript -e "tell application id \"$STR_BUNDLEID\" to quit"
045#############################################
046####インストール先を作っておく
047/bin/mkdir -p "/Users/${STAT_USR}/Applications/Utilities/"
048/bin/chmod 750 "/Users/${STAT_USR}/Applications/Utilities"
049/bin/chmod 700 "/Users/${STAT_USR}/Applications"
050/usr/bin/touch "/Users/${STAT_USR}/Applications/Utilities/.localized"
051#################################################
052###古いファイルをゴミ箱に
053function DO_MOVE_TO_TRASH() {
054  if [ -e "$1" ]; then
055    TRASH_DIR=$(/usr/bin/mktemp -d "/Users/${STAT_USR}/.Trash/XXXXXXXX")
056    /bin/chmod 777 "$TRASH_DIR"
057    /bin/mv "$1" "$TRASH_DIR"
058  fi
059}
060DO_MOVE_TO_TRASH "/Users/${STAT_USR}/Applications/Utilities/Keka.app"
061DO_MOVE_TO_TRASH "/Users/${STAT_USR}/Applications/Keka.app"
062DO_MOVE_TO_TRASH "/Applications/Keka.app"
063#############################################
064#### DMG in APP dittoインストール
065######### DITTO コピーインストール
066/bin/echo "インストール開始:DITTO:" "STAT_USR"
067###マウントポイント
068STR_MOUNTPOINT_PATH="$USER_TEMP_DIR/MountPoint/Keka"
069###マウントポイント作成
070/bin/mkdir -p "$STR_MOUNTPOINT_PATH"
071/bin/chmod 777 "$STR_MOUNTPOINT_PATH"
072###ディスクをマウント
073/usr/bin/hdiutil attach "$USER_TEMP_DIR/$DL_FILE_NAME" -noverify -nobrowse -noautoopen -mountpoint "$STR_MOUNTPOINT_PATH"
074/bin/echo "Done Disk mount"
075sleep 2
076####コピーして
077/bin/echo "start ditto"
078STR_APP_PATH="/Users/${STAT_USR}/Applications/Utilities/Keka.app"
079/usr/bin/ditto "$STR_MOUNTPOINT_PATH/Keka.app"  "$STR_APP_PATH"
080sleep 2
081/bin/echo "Done dittto"
082###ディスクをアンマウント
083/usr/bin/hdiutil detach "$STR_MOUNTPOINT_PATH" -force
084
085################################################
086### DOCKに登録済みかゴミ箱に入れる前に調べておく
087##Dockの登録数を調べる
088JSON_PERSISENT_APPS=$(/usr/bin/defaults read com.apple.dock persistent-apps)
089NUN_CNT_ITEM=$(/bin/echo "$JSON_PERSISENT_APPS" | grep -o "tile-data" | wc -l)
090/bin/echo "Dock登録数:$NUN_CNT_ITEM"
091##Dockの登録数だけ繰り返し
092NUM_CNT=0           #カウンタ初期化
093NUM_POSITION="NULL" #ポジション番号にNULL文字を入れる
094###対象のバンドルIDがDockに登録されているか順番に調べる
095while [ $NUM_CNT -lt "$NUN_CNT_ITEM" ]; do
096  ##順番にバンドルIDを取得して
097  STR_CHK_BUNDLEID=$(/usr/libexec/PlistBuddy -c "Print:persistent-apps:$NUM_CNT:tile-data:bundle-identifier" "$HOME/Library/Preferences/com.apple.dock.plist")
098  ##対象のバンドルIDだったら
099  if [ "$STR_CHK_BUNDLEID" = "$STR_BUNDLEID" ]; then
100    /bin/echo "DockのポジションNO: $NUM_CNT バンドルID:$STR_CHK_BUNDLEID"
101    ##位置情報ポジションを記憶しておく
102    NUM_POSITION=$NUM_CNT
103  fi
104  NUM_CNT=$((NUM_CNT + 1))
105done
106
107##結果 対象のバンドルIDが無ければ
108if [ "$NUM_POSITION" = "NULL" ]; then
109  /bin/echo "Dockに未登録です"
110  PLIST_DICT="<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>$STR_APP_PATH</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>"
111  /usr/bin/defaults write com.apple.dock persistent-apps -array-add "$PLIST_DICT"
112else
113  ##すでに登録済みの場合は一旦削除
114  /bin/echo "Dockの$NUM_POSITION に登録済み 削除してから同じ場所に登録しなおします"
115  ##削除して
116  /usr/libexec/PlistBuddy -c "Delete:persistent-apps:$NUM_POSITION" "$HOME/Library/Preferences/com.apple.dock.plist"
117  ##保存
118  /usr/libexec/PlistBuddy -c "Save" "$HOME/Library/Preferences/com.apple.dock.plist"
119  ###同じ内容を作成する
120  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION dict" "$HOME/Library/Preferences/com.apple.dock.plist"
121  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:GUID integer $RANDOM$RANDOM" "$HOME/Library/Preferences/com.apple.dock.plist"
122  ## 想定値 file-tile directory-tile
123  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-type string file-tile" "$HOME/Library/Preferences/com.apple.dock.plist"
124  ###↑この親Dictに子要素としてtile-dataをDictで追加
125  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data dict" "$HOME/Library/Preferences/com.apple.dock.plist"
126  ###↑子要素のtile-dataにキーと値を入れていく
127  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:showas integer 0" "$HOME/Library/Preferences/com.apple.dock.plist"
128  ## 想定値 2:フォルダ 41:アプリケーション 169 Launchpad とMission Control
129  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:file-type integer 41" "$HOME/Library/Preferences/com.apple.dock.plist"
130  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:displayas integer 0" "$HOME/Library/Preferences/com.apple.dock.plist"
131  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:parent-mod-date integer $(date '+%s')" "$HOME/Library/Preferences/com.apple.dock.plist"
132  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:file-mod-date integer $(date '+%s')" "$HOME/Library/Preferences/com.apple.dock.plist"
133  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:file-label string $STR_APP_NAME" "$HOME/Library/Preferences/com.apple.dock.plist"
134  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:is-beta bool false" "$HOME/Library/Preferences/com.apple.dock.plist"
135  ###↑この子要素のtile-dataに孫要素でfile-dataをDictで追加
136  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:file-data dict" "$HOME/Library/Preferences/com.apple.dock.plist"
137  ###値を入れていく
138  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:file-data:_CFURLStringType integer 15" "$HOME/Library/Preferences/com.apple.dock.plist"
139  /usr/libexec/PlistBuddy -c "add:persistent-apps:$NUM_POSITION:tile-data:file-data:_CFURLString string file://$STR_APP_PATH" "$HOME/Library/Preferences/com.apple.dock.plist"
140  ##保存
141  /usr/libexec/PlistBuddy -c "Save" "$HOME/Library/Preferences/com.apple.dock.plist"
142fi
143###
144/bin/echo "処理終了 DOCKを再起動します"
145/usr/bin/killall "Dock"
146
147
148exit 0
AppleScriptで生成しました

|

非圧縮zipを作る(ファイル指定)


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

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

property refMe : a reference to current application

set appFileManager to refMe's NSFileManager's defaultManager()

#############################
###ダイアログを前面に出す
set strName to (name of current application) as text
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
############ デフォルトロケーション
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
set aliasDefaultLocation to (ocidDesktopDirPathURL's absoluteURL()) as alias

############UTIリスト
set listUTI to {"public.data"}
set strMes to ("ファイルを選んでください") as text
set strPrompt to ("ファイルを選んでください") as text
try
  ### ファイル選択時
  set listAliasFilePath to (choose file strMes with prompt strPrompt default location (aliasDefaultLocation) of type listUTI with invisibles and showing package contents without multiple selections allowed) as list
on error
log "エラーしました"
return "エラーしました"
end try


repeat with itemAliasFilePath in listAliasFilePath
  
  set strFilePath to (POSIX path of itemAliasFilePath) as text
  set ocidFilePathStr to (refMe's NSString's stringWithString:(strFilePath))
  set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
  set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:false)
  set ocidContainerDirPathURL to ocidFilePathURL's URLByDeletingLastPathComponent()
  set ocidSaveFilePathURL to (ocidFilePathURL's URLByAppendingPathExtension:("zip"))
  #
  set ocidSaveFilePath to ocidSaveFilePathURL's |path|()
  set boolFileExists to (appFileManager's fileExistsAtPath:(ocidSaveFilePath) isDirectory:(false))
  if boolFileExists is true then
log "同名ファイルがある"
    set numCntNo to 1 as integer
    repeat
      set strSetValue to (numCntNo & ".zip") as text
      set ocidSaveFilePathURL to (ocidFilePathURL's URLByAppendingPathExtension:(strSetValue))
      set ocidSaveFilePath to ocidSaveFilePathURL's |path| as text
      set boolChkFileExists to (appFileManager's fileExistsAtPath:(ocidSaveFilePath) isDirectory:(false))
      if boolChkFileExists is false then
        set strSaveFilePath to ocidSaveFilePathURL's |path|() as text
        exit repeat
      end if
    end repeat
  else if boolFileExists is false then
log "同名ファイルが無いので処理する"
    set strSaveFilePath to ocidSaveFilePathURL's |path|() as text
  end if
  
  set strFilePath to ocidFilePathURL's |path| as text
  set strContainerDirPath to ocidContainerDirPathURL's |path| as text
  
  set strCommandText to ("pushd \"" & strContainerDirPath & "\" && '/usr/bin/zip' -0X \"" & strSaveFilePath & "\" \"" & strFilePath & "\"") as text
log strCommandText
do shell script strCommandText
  
end repeat





|

非圧縮zipを作る(フォルダ指定)


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

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


###Wクリックで起動した場合
on run
  set aliasDefaultLocation to (path to desktop from user domain) as alias
  set strPromptText to "フォルダをえらんでください"
  set strMesText to "フォルダをえらんでください"
  try
    set listFolderPath to (choose folder strMesText with prompt strPromptText default location aliasDefaultLocation with multiple selections allowed, invisibles and showing package contents) as list
  on error
log "エラーしました"
return "エラーしました"
  end try
open listFolderPath
end run

###ドロップで起動した場合
on open listFolderPath
  tell application "Finder"
    set strKind to (kind of (item 1 of listFolderPath)) as text
  end tell
  if strKind is not "フォルダ" then
return "フォルダ以外は処理しない"
  end if
  ####構造ファイルの名称を取得する
  repeat with itemFolderPath in listFolderPath
    set aliasFolderPath to itemFolderPath as alias
    tell application "Finder"
      tell folder aliasFolderPath
        set listContentsAlias to name of every folder as list
        set strDirName to name as text
      end tell
      set aliasContainerDirPath to (container of aliasFolderPath) as alias
    end tell
    set strContainerDirPath to (POSIX path of aliasContainerDirPath) as text
    set strDirPath to (POSIX path of aliasFolderPath) as text
    set strCommandText to ("pushd \"" & strDirPath & "\"") as text
log strCommandText
do shell script strCommandText
    
    set strCommandText to ("pushd \"" & strDirPath & "\" && '/usr/bin/zip' -0rX \"../" & strDirName & ".zip\" *") as text
log strCommandText
do shell script strCommandText
    
  end repeat
  
end open






|

[bash]UnarchiverDMGインストール


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

##################################
USER_WHOAMI=$(/usr/bin/whoami)
/bin/echo "実行ユーザー(whoami): $USER_WHOAMI"
###実行しているユーザー名
CONSOLE_USER=$(/bin/echo "show State:/Users/ConsoleUser" | /usr/sbin/scutil | /usr/bin/awk '/Name :/ { print $3 }')
/bin/echo "コンソールユーザー(scutil): $CONSOLE_USER"
###実行しているユーザー名
HOME_USER=$(/bin/echo "$HOME" | /usr/bin/awk -F'/' '{print $NF}')
/bin/echo "実行ユーザー(HOME): $HOME_USER"
###logname
LOGIN_NAME=$(/usr/bin/logname)
/bin/echo "ログイン名(logname): $LOGIN_NAME"
###UID
USER_NAME=$(/usr/bin/id -un)
/bin/echo "ユーザー名(id): $USER_NAME"
###STAT
STAT_USR=$(/usr/bin/stat -f%Su /dev/console)
/bin/echo "STAT_USR(console): $STAT_USR"
##################################
/bin/echo "インストール先確保" $HOME/Applications/Utilities
/bin/mkdir -p $HOME/Applications/Utilities
/bin/chmod 700 $HOME/Applications
/bin/chmod 755 $HOME/Applications/Utilities
/usr/bin/touch $HOME/Applications/.localized
/usr/bin/touch $HOME/Applications/Utilities/.localized
##################################
LIST_APPNAME=("unar" "Unarchiver")
for ITEM_APPNAME in "${LIST_APPNAME[@]}"; do
STR_PNO=$(/usr/bin/pgrep -f "$ITEM_APPNAME")
/bin/kill -9 "$STR_PNO"
done
##################################
STR_URL="https://dl.devmate.com/com.macpaw.site.theunarchiver/TheUnarchiver.dmg"
##ダウンロード先
STR_TMPDIRPATH=$(/usr/bin/mktemp -d)
/bin/chmod 777 "$STR_TMPDIRPATH"
/bin/echo "ダウンロード開始:" "$STR_TMPDIRPATH"
##生存確認
/usr/bin/curl -s --head "$STR_URL" >/dev/null
if [ $? -ne 0 ]; then
/bin/echo "エラー:URLの生存確認で失敗しました"
exit 1
fi
###リダイレクト先のURLを取得
STR_REDIRECT_URL=$(/usr/bin/curl -s -L -I -o /dev/null -w '%{url_effective}' "$STR_URL")
if [ $? -ne 0 ]; then
/bin/echo "エラー:リダイレクトの取得に失敗しました"
exit 1
fi
###ファイル名を取得
STR_FILE_NAME=$(/usr/bin/basename "$STR_REDIRECT_URL")
/bin/echo "ファイル名:$PKG_FILE_NAME"
###ダウンロード
/usr/bin/curl -L --retry 3 --retry-connrefused --retry-delay 3 -o "$STR_TMPDIRPATH/$STR_FILE_NAME" "$STR_URL"
if [ $? -ne 0 ]; then
/bin/echo "エラー:ダウンロードに失敗しました"
exit 1
fi
##################################
STR_DMG_PATH="$STR_TMPDIRPATH/$STR_FILE_NAME"
/usr/bin/hdiutil attach "$STR_DMG_PATH" -noverify -nobrowse -noautoopen
if [ $? -ne 0 ]; then
/bin/echo "エラー:ディスクのマウントで失敗しました"
exit 1
fi
##################################
STR_DIST_PATH="$HOME/Applications/Utilities/The Unarchiver.app/"
if [ -d "$STR_DIST_PATH" ]; then
/bin/echo "ファイルが存在します"
STR_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/Unarchiver.XXXXXXXX")
/bin/chmod 777 "$STR_TRASH_DIR"
/bin/mv -f "$STR_DIST_PATH" "$STR_TRASH_DIR"
/bin/echo "古いファイルをゴミ箱に入れました"
fi
##################################
STR_ORG_PATH="/Volumes/The Unarchiver/The Unarchiver.app"
/usr/bin/ditto "$STR_ORG_PATH" "$STR_DIST_PATH"
if [ $? -ne 0 ]; then
/usr/bin/hdiutil detach "/Volumes/The Unarchiver" -force
/bin/echo "エラー:ファイルのコピーで失敗しました"
exit 1
fi
##################################
/usr/bin/hdiutil detach "/Volumes/The Unarchiver" -force
if [ $? -ne 0 ]; then
/usr/bin/hdiutil detach "/Volumes/The Unarchiver 1" -force
/usr/bin/hdiutil detach "/Volumes/The Unarchiver 2" -force
/bin/echo "エラー:ディスクのアンマウントに失敗しました"
exit 1
fi
##################################
LIST_BUNDLEID=("cx.c3.theunarchiver" "com.macpaw.site.theunarchiver")
for ITEM_BUNDLEID in "${LIST_BUNDLEID[@]}"; do
/bin/echo "$ITEM_BUNDLEID"
/usr/bin/defaults write "$ITEM_BUNDLEID" createFolder -integer 2
/usr/bin/defaults write "$ITEM_BUNDLEID" extractionDestination -integer 1
/usr/bin/defaults write "$ITEM_BUNDLEID" folderModifiedDate -integer 2
/usr/bin/defaults write "$ITEM_BUNDLEID" LaunchCount -integer 0
/usr/bin/defaults write "$ITEM_BUNDLEID" filenameEncoding -integer 8
/usr/bin/defaults write "$ITEM_BUNDLEID" TUConfigInformationBannerViewedCount -integer 0
/usr/bin/defaults write "$ITEM_BUNDLEID" OnboardingUserViewedWelcomeSlide -bool true
/usr/bin/defaults write "$ITEM_BUNDLEID" SUEnableAutomaticChecks -bool true
/usr/bin/defaults write "$ITEM_BUNDLEID" userAgreedToNewTOSAndPrivacy -bool true
/usr/bin/defaults write "$ITEM_BUNDLEID" isFreshInstall -bool true
/usr/bin/defaults write "$ITEM_BUNDLEID" TUConfigInformationBannerOpened -bool true
/usr/bin/defaults write "$ITEM_BUNDLEID" deleteExtractedArchive -bool true
/usr/bin/defaults write "$ITEM_BUNDLEID" TUConfigInformationBannerOpened -bool true
/bin/echo "基本設定を行いました"
done

/usr/bin/killall cfprefsd

/bin/echo "終了しました"
exit 0


|

[bash]UnarchiverCLIインストール


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

##################################
USER_WHOAMI=$(/usr/bin/whoami)
/bin/echo "実行ユーザー(whoami): $USER_WHOAMI"
###実行しているユーザー名
CONSOLE_USER=$(/bin/echo "show State:/Users/ConsoleUser" | /usr/sbin/scutil | /usr/bin/awk '/Name :/ { print $3 }')
/bin/echo "コンソールユーザー(scutil): $CONSOLE_USER"
###実行しているユーザー名
HOME_USER=$(/bin/echo "$HOME" | /usr/bin/awk -F'/' '{print $NF}')
/bin/echo "実行ユーザー(HOME): $HOME_USER"
###logname
LOGIN_NAME=$(/usr/bin/logname)
/bin/echo "ログイン名(logname): $LOGIN_NAME"
###UID
USER_NAME=$(/usr/bin/id -un)
/bin/echo "ユーザー名(id): $USER_NAME"
###STAT
STAT_USR=$(/usr/bin/stat -f%Su /dev/console)
/bin/echo "STAT_USR(console): $STAT_USR"

##################################
STR_PNO=$(/usr/bin/pgrep -f "unar")
/bin/kill -9 "$STR_PNO"

##################################
STR_URL="https://cdn.theunarchiver.com/downloads/unarMac.zip"
##ダウンロード先
STR_TMPDIRPATH=$(/usr/bin/mktemp -d)
/bin/chmod 777 "$STR_TMPDIRPATH"
/bin/echo "ダウンロード開始:" "$STR_TMPDIRPATH"
##生存確認
/usr/bin/curl -s --head "$STR_URL" >/dev/null
if [ $? -ne 0 ]; then
/bin/echo "エラー:URLの生存確認で失敗しました"
exit 1
fi
###リダイレクト先のURLを取得
STR_REDIRECT_URL=$(/usr/bin/curl -s -L -I -o /dev/null -w '%{url_effective}' "$STR_URL")
if [ $? -ne 0 ]; then
/bin/echo "エラー:リダイレクトの取得に失敗しました"
exit 1
fi
###ファイル名を取得
STR_FILE_NAME=$(/usr/bin/basename "$STR_REDIRECT_URL")
/bin/echo "ファイル名:$PKG_FILE_NAME"
###ダウンロード
/usr/bin/curl -L --retry 3 --retry-connrefused --retry-delay 3 -o "$STR_TMPDIRPATH/$STR_FILE_NAME" "$STR_URL"
if [ $? -ne 0 ]; then
/bin/echo "エラー:ダウンロードに失敗しました"
exit 1
fi
##################################
STR_DIST_PATH="$HOME/bin/unarMac/"
if [ -d "$STR_DIST_PATH" ]; then
/bin/echo "ファイルが存在します"
STR_TRASH_DIR=$(/usr/bin/mktemp -d "$HOME/.Trash/Unarchiver.XXXXXXXX")
/bin/chmod 777 "$STR_TRASH_DIR"
/bin/mv -f "$STR_DIST_PATH" "$STR_TRASH_DIR"
/bin/echo "古いファイルをゴミ箱に入れました"
fi
##################################
/bin/echo "インストール先確保" $HOME/bin/unarMac
/bin/mkdir -p $HOME/bin/unarMac
/bin/chmod 700 $HOME/bin
/bin/chmod 755 $HOME/bin/unarMac
##################################
/usr/bin/ditto -xk "$STR_TMPDIRPATH/$STR_FILE_NAME" "$STR_DIST_PATH"
if [ $? -ne 0 ]; then
/bin/echo "エラー:ファイルのコピーで失敗しました"
exit 1
fi
/bin/echo "終了しました"
exit 0


|

圧縮・解凍(2024)

圧縮解凍
圧縮解凍:Keka
https://www.keka.io/ja/
解凍:The Unarchiver
https://theunarchiver.com
圧縮解凍:Archive Utility
/System/Library/CoreServices/Applications/Archive Utility.app
Archive Utility 関連詰め合わせ
https://quicktimer.cocolog-nifty.com/icefloe/files/archive20utility.zip
圧縮解凍:ZIPANG[LINK]
ミラー
zipang.zip
zipangfull.zip



拡張子:zip
/usr/bin/zip
/usr/bin/unzip
/usr/bin/zipgrep
/usr/bin/zipinfo
/usr/bin/zipnote
/usr/bin/zipsplit
/usr/bin/zipdetails
/usr/bin/zipcloak
パスワード付きZip圧縮
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-5953ab.html
[ドロップレット]EPUB用zip圧縮(半角スペース対応)
https://quicktimer.cocolog-nifty.com/icefloe/2023/11/post-c6729c.html


拡張子:tar gz bz2 xz Z
圧縮解凍:/usr/bin/tar →/usr/bin/bsdtar


拡張子:.gz
https://quicktimer.cocolog-nifty.com/icefloe/2024/01/post-a8b24c.html
圧縮:/usr/bin/gzip
解凍 :/usr/bin/gunzip →/usr/bin/zcat
出力:/usr/bin/zcat


拡張子:bz2
https://quicktimer.cocolog-nifty.com/icefloe/2024/02/post-cd5c00.html
圧縮:/usr/bin/bzip2
解凍:/usr/bin/bunzip2
出力:/usr/bin/bzcat


拡張子:Z
圧縮解凍:/usr/bin/compress


その他インストールが必要なコマンドラインツール
解凍:unar Unarchiverのコマンドラインツール
https://github.com/ashang/unar
バイナリーはこちらから
https://theunarchiver.com/command-line


圧縮解凍:7-Zip
https://7-zip.org/
Mac版はこちらから
https://www.7-zip.org/download.html
[AppleScript]7zzインストール
https://quicktimer.cocolog-nifty.com/icefloe/2024/01/post-01fee7.html
[7zz]パスワード付きで圧縮する
https://quicktimer.cocolog-nifty.com/icefloe/2023/05/post-3dbc87.html

|

拡張子:bz2

拡張子:bz2
圧縮:/usr/bin/bzip2
解凍:/usr/bin/bunzip2
出力:/usr/bin/bzcat



-h --help print this message
-d --decompress 解凍:force decompression
-z --compress 圧縮:force compression
-k --keep 入力ファイルを削除しないkeep (don't delete) input files
-f --force 出力ファイル上書き:overwrite existing output files
-t --test test compressed file integrity
-c --stdout 標準出力:output to standard out
-q --quiet ログ出力しない:suppress noncritical error messages
-v --verbose メッセージ出力:be verbose (a 2nd -v gives more)
-L --license display software version & license
-V --version display software version & license
-s --small メモリー消費を少なく:use less memory (at most 2500k)
-1 .. -9 set block size to 100k .. 900k
--fast alias for -1
--best alias for -9
数値が少ないと圧縮率が低く 高速
数値が多いと圧縮率が高く 低速



#!/bin/bash

# 入力ファイル/some/inputfileは削除される
/usr/bin/bzip2 /some/inputfile

#入力ファイルを残す
/usr/bin/bzip2 --keep /some/inputfile
/usr/bin/bzip2 -k /some/inputfile

#圧縮ファイル名を指定する オリジナルを残す
/usr/bin/bzip2 --keep /some/inputfile --stdout > /some/inputfile.bz2
/usr/bin/bzip2 -k /some/inputfile -c > /some/inputfile.bz2

|

パスワード付きZip圧縮


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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
# ドロップレットとしても使えます
# ファイル>書き出し>アプリケーション で書き出してください
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.6"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application
property strBinPath : "/usr/bin/zip"

on run
  set appFileManager to refMe's NSFileManager's defaultManager()
  #############################
  ###ダイアログ
  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 appFileManager to refMe's NSFileManager's defaultManager()
  set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
  set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
  set aliasDefaultLocation to (ocidDesktopDirPathURL's absoluteURL()) as alias
  set listUTI to {"public.item"}
  set strMes to ("ファイルを選んでください") as text
  set strPrompt to ("ファイルを選んでください") as text
  try
    set listDropObject to (choose file strMes with prompt strPrompt default location aliasDefaultLocation of type listUTI with invisibles, multiple selections allowed and showing package contents) as list
  on error
return "エラーしました"
  end try
  
open listDropObject
end run


on open listDropObject
  ###NSFileManager初期化
  set appFileManager to refMe's NSFileManager's defaultManager()
  ###Path to me
  tell application "Finder"
    set aliasPathToMe to (path to me) as alias
  end tell
  ###ドロップの数だけ繰返し
  repeat with itemDropObject in listDropObject
    #################################
    ###処理する判定
    set boolChkAliasPath to true as boolean
    try
      tell application "Finder"
        set strKind to (kind of itemDropObject) as text
      end tell
    on error
log "kindを取得できないファイルは処理しない"
      set boolChkAliasPath to false as boolean
    end try
    if strKind is "アプリケーション" then
log "アプリケーションは処理しない"
      set boolChkAliasPath to false as boolean
    else if strKind is "ボリューム" then
log "ボリュームは処理しない"
      set boolChkAliasPath to false as boolean
    else if strKind is "エイリアス" then
log "エイリアスは処理しない"
      set boolChkAliasPath to false as boolean
    end if
    #################################
    ###trueの場合のみ圧縮処理する
    if boolChkAliasPath is true then
      ########################################
      #####パスワード生成 UUIDを利用
      ###生成したUUIDからハイフンを取り除く
      set ocidUUIDString to (refMe's NSMutableString's alloc()'s initWithCapacity:0)
      set ocidConcreteUUID to refMe's NSUUID's UUID()
(ocidUUIDString's setString:(ocidConcreteUUID's UUIDString()))
      set ocidUUIDRange to (ocidUUIDString's rangeOfString:ocidUUIDString)
(ocidUUIDString's replaceOccurrencesOfString:("-") withString:("") options:(refMe's NSRegularExpressionSearch) range:ocidUUIDRange)
      set strOwnerPassword to ocidUUIDString as text
      ########################################
      #####パス
      set strFilePath to (POSIX path of itemDropObject) as text
      set ocidFilePathStr to (refMe's NSString's stringWithString:(strFilePath))
      set ocidFilePath to ocidFilePathStr's stringByStandardizingPath
      set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:ocidFilePath isDirectory:false)
      set ocidDirName to ocidFilePathURL's lastPathComponent()
      set ocidContainerDirPathURL to ocidFilePathURL's URLByDeletingLastPathComponent()
      set strDirName to ocidDirName as text
      set strMakeDirName to (strDirName & "_圧縮済")
      set ocidBaseFilePathURL to (ocidContainerDirPathURL's URLByAppendingPathComponent:strMakeDirName)
      #####################
      ###フォルダを作る
      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:(ocidBaseFilePathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error|:(reference))
      #####################
      ###zipPath
      set ocidDirFilePathURL to (ocidBaseFilePathURL's URLByAppendingPathComponent:(ocidDirName))
      set ocidZipFilePathURL to (ocidDirFilePathURL's URLByAppendingPathExtension:"zip")
      set strZipFilePathURL to ocidZipFilePathURL's |path|() as text
      ########################################
      #####パスワード生成 UUIDを利用
      set strTextFileName to strDirName & ".pw.txt"
      set ocidTextFilePathURL to (ocidBaseFilePathURL's URLByAppendingPathComponent:strTextFileName)
      ###テキスト
      set strTextFile to "先にお送りしました圧縮ファイル\n『" & strDirName & "』の\n解凍パスワードをお知らせします\n\n" & strOwnerPassword & "\n\n解凍出来ない等ありましたらお知らせください。\n(パスワードをコピー&ペーストする際に\n改行やスペースが入らないように留意ください)\n" as text
      set ocidPWString to (refMe's NSString's stringWithString:strTextFile)
      set ocidUUIDData to (ocidPWString's dataUsingEncoding:(refMe's NSUTF8StringEncoding))
      #####パスワードを書いたテキストファイルを保存
      set boolResults to (ocidUUIDData's writeToURL:ocidTextFilePathURL atomically:true)
      ########################################
      #####コマンド実行
      ###パス情報を残す
      ##set strCommandText to ("\"" & strBinPath & "\" -X -e -P " & strOwnerPassword & " \"" & strZipFilePathURL & "\" -r \"" & strFilePath & "\"")
      ###パス情報を残さない
      set strCommandText to ("\"" & strBinPath & "\" -j -X -e -P " & strOwnerPassword & " \"" & strZipFilePathURL & "\" -r \"" & strFilePath & "\"")
log strCommandText
do shell script strCommandText
    end if
  end repeat
return "処理終了"
end open



|

拡張子:gz

拡張子:bz2
圧縮:/usr/bin/gzip
解凍 :/usr/bin/gunzip →/usr/bin/zcat
出力:/usr/bin/zcat



-h --help print this message
-d --decompress 解凍:force decompression
-z --compress 圧縮:force compression
-k --keep 入力ファイルを削除しないkeep (don't delete) input files
-f --force 出力ファイル上書き:overwrite existing output files
-t --test test compressed file integrity
-c --stdout 標準出力:output to standard out
-q --quiet ログ出力しない:suppress noncritical error messages
-v --verbose メッセージ出力:be verbose (a 2nd -v gives more)
-L --license display software version & license
-V --version display software version & license
-s --small メモリー消費を少なく:use less memory (at most 2500k)
-1 .. -9 set block size to 100k .. 900k
--fast alias for -1
--best alias for -9
数値が少ないと圧縮率が低く 高速
数値が多いと圧縮率が高く 低速



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

# 入力ファイル/some/inputfileは削除される
/usr/bin/gzip /some/inputfile

#入力ファイルを残す
/usr/bin/gzip --keep /some/inputfile
/usr/bin/gzip -k /some/inputfile

#圧縮ファイル名を指定する オリジナルを残す
/usr/bin/gzip -keep /some/inputfile -c > /some/inputfile.gz
/usr/bin/gzip -k /some/inputfile -c > /some/inputfile.gz

exit 0

|

[AppleScript]7zzインストール


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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#com.cocolog-nifty.quicktimer.icefloe
# 7zz を /Users/実行したユーザー名/bin/7zipにインストールします
----+----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 strURL to "https://sourceforge.net/projects/sevenzip/rss" as text


################################################
###### RSSデータ保存
################################################
###ディレクトリ
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidTempDirURL to appFileManager's temporaryDirectory()
set ocidUUID to refMe's NSUUID's alloc()'s init()
set ocidUUIDString to ocidUUID's UUIDString
set ocidSaveDirPathURL to ocidTempDirURL's URLByAppendingPathComponent:(ocidUUIDString) isDirectory:true
set ocidAttrDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
# 777-->511 755-->493 700-->448 766-->502
ocidAttrDict's setValue:(511) forKey:(refMe's NSFilePosixPermissions)
set listBoolMakeDir to appFileManager's createDirectoryAtURL:(ocidSaveDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error|:(reference)
###パス
set strFileName to "feed.xml" as text
set ocidSaveFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:(strFileName) isDirectory:false
set strSaveFilePath to ocidSaveFilePathURL's |path|() as text

set strCommandText to ("/usr/bin/curl \"" & strURL & "\" -o \"" & strSaveFilePath & "\"")
do shell script strCommandText
################################################
###### データ読み込み
################################################
set ocidOption to (refMe's NSXMLDocumentTidyXML)
set listReadXML to refMe's NSXMLDocument's alloc()'s initWithContentsOfURL:(ocidSaveFilePathURL) options:(ocidOption) |error|:(reference)
set ocidXMLDoc to (item 1 of listReadXML)

################################################
###### リンク取得
################################################
### root
set ocidRootElement to ocidXMLDoc's rootElement()
### channel
set ocidChannel to ocidRootElement's elementsForName:("channel")
set ocidChannelElement to ocidChannel's firstObject()
### ITEM
set ocidItemArray to (ocidChannelElement's elementsForName:("item"))
###リンク取得
set listURL to {} as list
repeat with itemElement in ocidItemArray
  set strItemTitle to (itemElement's elementsForName:("title"))'s stringValue as text
  ###
  if strItemTitle contains "mac.tar.xz" then
    set strItemLink to (itemElement's elementsForName:("link"))'s stringValue as text
    set end of listURL to strItemLink
  end if
end repeat

################################################
###### 念の為ソートする
################################################
set ocidURLArray to refMe's NSArray's arrayWithArray:(listURL)
set ocidURLArrayM to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
(ocidURLArrayM's addObjectsFromArray:(ocidURLArray))
###並び替え
set ocidDescriptor to (refMe's NSSortDescriptor's sortDescriptorWithKey:("self") ascending:(false) selector:"localizedStandardCompare:")
ocidURLArrayM's sortUsingDescriptors:{ocidDescriptor}
set strNewerFileURL to (ocidURLArrayM's firstObject()) as text
###取り出したダウンロードURL(最新)
set ocidURLString to refMe's NSString's stringWithString:(strNewerFileURL)
set ocidURL to refMe's NSURL's alloc()'s initWithString:(ocidURLString)
set ocidLastPathURL to ocidURL's URLByDeletingLastPathComponent()
###ファイル名
set strFileName to (ocidLastPathURL's lastPathComponent()) as text
###ダウンロードURL上書き
set strURL to ("https://www.7-zip.org/a/" & strFileName) as text
set ocidURLString to refMe's NSString's stringWithString:(strURL)
set ocidURL to refMe's NSURL's alloc()'s initWithString:(ocidURLString)

################################################
###### URLRequest部分
################################################
set ocidURLRequest to refMe's NSMutableURLRequest's alloc()'s init()
ocidURLRequest's setHTTPMethod:"GET"
ocidURLRequest's setURL:(ocidURL)
ocidURLRequest's addValue:"application/xml" forHTTPHeaderField:"Content-Type"
ocidURLRequest's setHTTPBody:(missing value)
################################################
###### データ取得
################################################
set ocidServerResponse to refMe's NSURLConnection's sendSynchronousRequest:(ocidURLRequest) returningResponse:(missing value) |error|:(reference)
###取得
set ocidXZData to (item 1 of ocidServerResponse)
################################################
###### 保存先
################################################
###保存先 ディレクトリ
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidTempDirURL to appFileManager's temporaryDirectory()
set ocidUUID to refMe's NSUUID's alloc()'s init()
set ocidUUIDString to ocidUUID's UUIDString
set ocidSaveDirPathURL to ocidTempDirURL's URLByAppendingPathComponent:(ocidUUIDString) isDirectory:true
###フォルダ作る
set ocidAttrDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
# 777-->511 755-->493 700-->448 766-->502
ocidAttrDict's setValue:(511) forKey:(refMe's NSFilePosixPermissions)
set listBoolMakeDir to appFileManager's createDirectoryAtURL:(ocidSaveDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error|:(reference)
###保存パス
set ocidSaveFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:(strFileName) isDirectory:false
set strSaveFilePathURL to (ocidSaveFilePathURL's |path|()) as text
####保存
set listDone to ocidXZData's writeToURL:(ocidSaveFilePathURL) options:(refMe's NSDataWritingAtomic) |error|:(reference)
################################################
###### 展開
################################################
###展開先
set ocidHomeDirURL to appFileManager's homeDirectoryForCurrentUser()
set ocidSaveDirPathURL to ocidHomeDirURL's URLByAppendingPathComponent:("bin/7zip") isDirectory:true
set strSaveDirPathURL to (ocidSaveDirPathURL's |path|()) as text
###フォルダ作る
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 strCommandText to ("/usr/bin/bsdtar -xvzf \"" & strSaveFilePathURL & "\" -C \"" & strSaveDirPathURL & "\"") as text
set strResponse to (do shell script strCommandText) as text


###################################
###保存先を開く
###################################
set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace()
set boolDone to appSharedWorkspace's openURL:(ocidSaveDirPathURL)
if boolDone is false then
  set aliasFilePathURL to (ocidSaveDirPathURL's absoluteURL()) as alias
  set boolResults to (appShardWorkspace's openURL:ocidCloudStorageDirURL)
  if boolResults is false then
    tell application "Finder"
make new Finder window to aliasFilePathURL
    end tell
  end if
end if




|

その他のカテゴリー

Acrobat Acrobat Annotation Acrobat BookMark Acrobat Dialog Acrobat Distiller Acrobat Form Acrobat JS Acrobat Manifest Acrobat Open Acrobat Plugin Acrobat Preflight Acrobat python Acrobat Reader Acrobat SCA Acrobat Sequ Acrobat Sign 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 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 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 Guide 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 Mail 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 NSFileManager enumeratorAtURL 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 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 Events Plist 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 savedSearch AppleScript XML SVG AppleScript XML TTML AppleScript XML webloc AppleScript XMP AppleScript YouTube AppleScript Zero Suppress Applications CityCode Design github 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