AppleScript DropBox

[DropBox]最新版のURLを取得する


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

#!/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
property refNSNotFound : a reference to 9.22337203685477E+18 + 5807

set strBundleID to ("com.getdropbox.dropbox") as text

set strURL to ("https://www.dropboxforum.com/mxpez29397/rss/board?board.id=101003016") as text
set coidBaseURLStr to refMe's NSString's stringWithString:(strURL)
set ocidBaseURL to refMe's NSURL's URLWithString:(coidBaseURLStr)

################################################
###### URLRequest部分
################################################
set ocidURLRequest to refMe's NSMutableURLRequest's alloc()'s init()
ocidURLRequest's setHTTPMethod:"GET"
ocidURLRequest's setURL:(ocidBaseURL)
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 ocidXMLData to (item 1 of ocidServerResponse)
###ROOTエレメント
set listXMLDoc to refMe's NSXMLDocument's alloc()'s initWithData:(ocidXMLData) options:(refMe's NSXMLDocumentTidyXML) |error|:(reference)
set ocidXMLDoc to item 1 of listXMLDoc
set ocidRootElement to ocidXMLDoc's rootElement()
##channelエレメント
set ocidChannel to ocidRootElement's elementsForName:("channel")
set ocidChannelElement to ocidChannel's firstObject()
set strMainTitle to (ocidChannelElement's elementsForName:("title"))'s stringValue as text
log strMainTitle
###itemエレメント
set ocidItemArray to (ocidChannelElement's elementsForName:("item"))
##
set strContantsHtml to ("") as text
repeat with itemArray in ocidItemArray
  set strItemTitle to (itemArray's elementsForName:("title"))'s stringValue as text
  if strItemTitle contains "Stable" then
    set strItemDescription to (itemArray's elementsForName:("description"))'s stringValue as text
    set strContantsHtml to (strContantsHtml & "<hr>" & strItemDescription) as text
    exit repeat
  end if
end repeat

###テキストにして
set ocidHTML to refMe's NSString's stringWithString:(strContantsHtml)
###ある程度の整形
set ocidHTML to (ocidHTML's stringByReplacingOccurrencesOfString:("\r") withString:(""))
set ocidHTML to (ocidHTML's stringByReplacingOccurrencesOfString:("\n") withString:(""))
set ocidHTML to (ocidHTML's stringByReplacingOccurrencesOfString:("\t") withString:(""))
##修正が必要な項目は修正
set ocidHTML to (ocidHTML's stringByReplacingOccurrencesOfString:("</A>") withString:("</a>\n"))
set ocidHTML to (ocidHTML's stringByReplacingOccurrencesOfString:("<A") withString:("\n<a"))

##改行毎のARRAYにして
set ocidHTMLArray to ocidHTML's componentsSeparatedByString:("\n")
##URL格納用のDICT
set ocidURLDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
##処理
repeat with itemArray in ocidHTMLArray
  #aタグのみ処理
  set ocidRange to (itemArray's rangeOfString:("<a"))
  if (ocidRange's location()) ≠ refNSNotFound then
    try
      #aタグの内容をエレメントに格納
      set listAElement to (refMe's NSXMLElement's alloc()'s initWithXMLString:(itemArray) |error|:(reference))
      set ocidAelement to (item 1 of listAElement)
      #URLを取得
      set ocidValue to (ocidAelement's attributeForName:("href"))'s stringValue
      #対象のパス名が含まれているか?
      set ocidRange to (ocidValue's rangeOfString:("downloading"))
      if (ocidRange's location()) ≠ refNSNotFound then
        set ocidKeyName to ocidAelement's stringValue()
        #相対パス記述の場合にベースURLを付与
        if (ocidValue as text) starts with "/" then
(ocidURLComponents's setPath:(ocidValue))
          set ocidValue to (ocidURLComponents's |URL|)'s absoluteString()
        end if
        #格納用のDICTに格納していく
(ocidURLDict's setValue:(ocidValue) forKey:(ocidKeyName))
      end if
    on error
log ("hrefアトリヴュートが無いか?エレメント構造にエラーがあります: " & itemArray) as text
    end try
  end if
  
end repeat
###ここまでの内容
log ocidURLDict as record
set ocidUrlAllKey to ocidURLDict's allKeys()

set ocidOutputText to refMe's NSMutableString's alloc()'s initWithCapacity:0
repeat with itemKey in ocidUrlAllKey
(ocidOutputText's appendString:(itemKey))
(ocidOutputText's appendString:("\n"))
  set ocidSetValue to (ocidURLDict's valueForKey:(itemKey))
(ocidOutputText's appendString:(ocidSetValue))
(ocidOutputText's appendString:("\n"))
end repeat

set ocidARMurl to (ocidURLDict's valueForKey:(" Offline Installer (Apple Silicon) "))

################################################
###### インストール済みのパージョン
################################################
set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace()
##バンドルからアプリケーションのURLを取得
set ocidAppBundle to (refMe's NSBundle's bundleWithIdentifier:(strBundleID))
if ocidAppBundle ≠ (missing value) then
  set ocidAppPathURL to ocidAppBundle's bundleURL()
else if ocidAppBundle = (missing value) then
  set ocidAppPathURL to (appSharedWorkspace's URLForApplicationWithBundleIdentifier:(strBundleID))
end if
##予備(アプリケーションのURL)
if ocidAppPathURL = (missing value) then
  tell application "Finder"
    try
      set aliasAppApth to (application file id strBundleID) as alias
      set strAppPath to POSIX path of aliasAppApth as text
      set strAppPathStr to refMe's NSString's stringWithString:(strAppPath)
      set strAppPath to strAppPathStr's stringByStandardizingPath()
      set ocidAppPathURL to refMe's NSURL's alloc()'s initFileURLWithPath:(strAppPath) isDirectory:true
    on error
return "アプリケーションが見つかりませんでした"
    end try
  end tell
end if
set ocidFilePathURL to ocidAppPathURL's URLByAppendingPathComponent:("Contents/Info.plist")
#####PLISTの内容を読み込んで
set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
set listReadPlistData to refMe's NSMutableDictionary's dictionaryWithContentsOfURL:ocidFilePathURL |error|:(reference)
set ocidPlistDict to item 1 of listReadPlistData
set ocidCfbundleversionPlist to ocidPlistDict's valueForKey:"CFBundleVersion"


################################################
###### ダイアログ
################################################
set appFileManager to refMe's NSFileManager's defaultManager()


####ダイアログに指定アプリのアイコンを表示する
###アイコン名をPLISTから取得
set strIconFileName to (ocidPlistDict's valueForKey:("CFBundleIconFile")) as text
###ICONのURLにして
set strPath to ("Contents/Resources/" & strIconFileName) as text
set ocidIconFilePathURL to ocidAppPathURL's URLByAppendingPathComponent:(strPath) isDirectory:false
###拡張子の有無チェック
set strExtensionName to (ocidIconFilePathURL's pathExtension()) as text
if strExtensionName is "" then
  set ocidIconFilePathURL to ocidIconFilePathURL's URLByAppendingPathExtension:"icns"
end if
##-->これがアイコンパス
log ocidIconFilePathURL's absoluteString() as text
###ICONファイルが実際にあるか?チェック
set boolExists to appFileManager's fileExistsAtPath:(ocidIconFilePathURL's |path|)
###ICONがみつかない時用にデフォルトを用意する
if boolExists is false then
  set aliasIconPath to POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertNoteIcon.icns"
else
  set aliasIconPath to ocidIconFilePathURL's absoluteURL() as alias
  set strIconPath to ocidIconFilePathURL's |path|() as text
end if
set strCom to "最新バージョンのURLです\nインテルMacはOffline Installer (Intel)\nARMはOffline Installer (Apple Silicon)です"
set strTitle to "戻り値です"
set strMes to ocidOutputText as text
set recordResult to (display dialog strCom with title strTitle default answer strMes buttons {"クリップボードにコピー", "終了", "ダウンロード"} default button "ダウンロード" cancel button "終了" giving up after 20 with icon aliasIconPath without hidden answer)

if button returned of recordResult is "ダウンロード" then
  tell application "Finder"
open location (ocidARMurl as text)
  end tell
end if
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


|

[DropBox]最新版のURLをHTML表示する


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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
(*
DROP BOXの最新版リンクをHTML表示します
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 strURL to ("https://www.dropboxforum.com/mxpez29397/rss/board?board.id=101003016") as text
set coidBaseURLStr to refMe's NSString's stringWithString:(strURL)
set ocidBaseURL to refMe's NSURL's URLWithString:(coidBaseURLStr)

################################################
###### URLRequest部分
################################################
set ocidURLRequest to refMe's NSMutableURLRequest's alloc()'s init()
ocidURLRequest's setHTTPMethod:"GET"
ocidURLRequest's setURL:(ocidBaseURL)
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 ocidXMLData to (item 1 of ocidServerResponse)
###ROOTエレメント
set listXMLDoc to refMe's NSXMLDocument's alloc()'s initWithData:(ocidXMLData) options:(refMe's NSXMLDocumentTidyXML) |error|:(reference)
set ocidXMLDoc to item 1 of listXMLDoc
set ocidRootElement to ocidXMLDoc's rootElement()
##channelエレメント
set ocidChannel to ocidRootElement's elementsForName:("channel")
set ocidChannelElement to ocidChannel's firstObject()
set strMainTitle to (ocidChannelElement's elementsForName:("title"))'s stringValue as text
log strMainTitle
###itemエレメント
set ocidItemArray to (ocidChannelElement's elementsForName:("item"))
##
set strContantsHtml to ("") as text
repeat with itemArray in ocidItemArray
  set strItemTitle to (itemArray's elementsForName:("title"))'s stringValue as text
  if strItemTitle contains "Stable" then
    set strItemDescription to (itemArray's elementsForName:("description"))'s stringValue as text
    set strContantsHtml to (strContantsHtml & "<hr>" & strItemDescription) as text
    exit repeat
  end if
end repeat

################################################
##保存先
################################################
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 strSaveFileName to ("dropbox.html") as text
##保存ファイルパス
set ocidSaveFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:(strSaveFileName)


########################################
##HTML 基本構造
###スタイル
set strStylle to "<style>table {padding: 10px;width: 100%;margin: 0;border-collapse: collapse;border-spacing: 0;word-wrap: break-word;} table { width: 80%;margin: 0px;padding: 0px;border: 0px;border-spacing:0px;border-collapse: collapse;} caption { font-weight: 900;} thead { font-weight: 600;border-spacing:0px;} td {border: solid 1px #666666;padding: 5px;margin: 0px;word-wrap: break-word;border-spacing:0px;} tr {border: solid 1px #666666;padding: 0px;margin: 0px;border-spacing:0px;} th {border: solid 1px #666666;padding: 0px;margin: 0px;border-spacing:0px;}</style>" as text
###ヘッダー部
set strHead to "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"utf-8\"><title>" & strMainTitle & "</title>" & strStylle & "</head><body>" as text

###HTML書き出し用のテキスト初期化
set ocidHTMLString to refMe's NSMutableString's alloc()'s initWithCapacity:0
####
ocidHTMLString's appendString:(strHead)
ocidHTMLString's appendString:(strContantsHtml)
###最後
set strHtmlEndBody to "</body></html>"
ocidHTMLString's appendString:(strHtmlEndBody)

set listDone to ocidHTMLString's writeToURL:(ocidSaveFilePathURL) atomically:(true) encoding:(refMe's NSUTF8StringEncoding) |error|:(reference)


####【9】Finderで開く
set strFilePath to ocidSaveFilePathURL's |path| as text
set strFilePathURL to ocidSaveFilePathURL's absoluteString() as text
set aliasFilePath to (ocidSaveFilePathURL's absoluteURL()) as alias

tell application "Finder"
open location aliasFilePath
end tell

|

[AS]エラーメッセージをダイアログに表示


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

#!/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 ocidHomeDirUrl to appFileManager's homeDirectoryForCurrentUser()
set ocidSauceDirPathURL to ocidHomeDirUrl's URLByAppendingPathComponent:"Library/Scripts"
set strSauceDirPath to (ocidSauceDirPathURL's |path|()) as text
###################################
#####コピー先フォルダ
###################################
set ocidDistDirPathURL to ocidHomeDirUrl's URLByAppendingPathComponent:"Library/CloudStorage/Dropbox/Scripts"
set strDistDirPath to (ocidDistDirPathURL's |path|()) as text

###################################
#####コマンド実行
###################################

set strCommandText to "/usr/bin/ditto \"" & strSauceDirPath & "\" \"" & strDistDirPath & "\"" as text
try
  set strResponse to (do shell script strCommandText) as text
  ###エラーが発生したらダイアログにエラーメッセージを渡す
on error strResponse
  #####ダイアログを前面に
  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 aliasIconPath to POSIX file "/Applications/Dropbox.app/Contents/Resources/AppIcon.icns" as alias
  display dialog "一部エラーが発生しました\r確認してください" with title "エラーメッセージ" default answer strResponse buttons {"OK", "キャンセル"} default button "OK" cancel button "キャンセル" with icon aliasIconPath giving up after 20 without hidden answer
end try




|

[DropBox]エイリアスをデスクトップに作る(修正)


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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
# デスクトップにDropBoxのエイリアスをアイコン付きで作ります
#
#
# 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 strAddAliasFilePath to "~/Desktop/Dropbox" as text
###元ファイルは?
set strOrgFilePath to "~/Library/CloudStorage/Dropbox" as text
###アイコンどうする?
set boolSetIcon to true as boolean
if boolSetIcon is true then
  set strIconFilePath to "/Applications/Dropbox.app/Contents/Resources/AppIcon.icns" as text
end if

####################################
####エイリアスが作られる場所
set ocidAddAliasFilePathStr to refMe's NSString's stringWithString:strAddAliasFilePath
set ocidAddAliasFilePath to ocidAddAliasFilePathStr's stringByStandardizingPath
set ocidAddAliasFilePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:ocidAddAliasFilePath isDirectory:false
set strAddAliasFilePathURL to ocidAddAliasFilePathURL's |path|() as text

###ディレクトリを作る必要があれば作る
set ocidAddAliasDirFilePathURL to ocidAddAliasFilePathURL's URLByDeletingLastPathComponent()
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:(ocidAddAliasDirFilePathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error|:(reference)

####################################
####エイリアスの元ファイル
####################################
set ocidFilePathStr to refMe's NSString's stringWithString:strOrgFilePath
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath
set ocidFilePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:ocidFilePath isDirectory:false

####################################
#### エイリアスを作る
####################################
set listBookMarkNSData to (ocidFilePathURL's bookmarkDataWithOptions:(refMe's NSURLBookmarkCreationSuitableForBookmarkFile) includingResourceValuesForKeys:{refMe's NSURLCustomIconKey} relativeToURL:(missing value) |error|:(reference))
set ocdiBookMarkData to (item 1 of listBookMarkNSData)
set listResults to (refMe's NSURL's writeBookmarkData:(ocdiBookMarkData) toURL:(ocidAddAliasFilePathURL) options:(refMe's NSURLBookmarkCreationSuitableForBookmarkFile) |error|:(reference))

####################################
#### アイコンを付与
####################################
if boolSetIcon is true then
  ###ICONパス
  set ocidIconPathStr to refMe's NSString's stringWithString:(strIconFilePath)
  set ocidIconPath to ocidIconPathStr's stringByStandardizingPath()
  set ocidIconPathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidIconPath) isDirectory:false)
  ##アイコン用のイメージデータ取得
  set ocidImageData to (refMe's NSImage's alloc()'s initWithContentsOfURL:(ocidIconPathURL))
  ###NSWorkspace初期化
  set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace()
  ###アイコン付与
  set boolAddIcon to (appSharedWorkspace's setIcon:(ocidImageData) forFile:(ocidAddAliasFilePath) options:(refMe's NSExclude10_4ElementsIconCreationOption))
end if

return

|

[Dropbox]サインレト・インストール(bash)


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

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

########################################
###管理者インストールしているか?チェック
USER_WHOAMI=$(/usr/bin/whoami)
/bin/echo "実行したユーザーは:$USER_WHOAMI"
if [ "$USER_WHOAMI" != "root" ]; then
  /bin/echo "このスクリプトを実行するには管理者権限が必要です。"
  /bin/echo "sudo で実行してください"
  ### path to me
  SCRIPT_PATH="${BASH_SOURCE[0]}"
  /bin/echo "/usr/bin/sudo \"$SCRIPT_PATH\""
  /bin/echo "↑を実行してください"
  exit 1
else
  ###実行しているユーザー名
  SUDO_USER=$(/bin/echo "$HOME" | /usr/bin/awk -F'/' '{print $NF}')
  /bin/echo "実行ユーザー:" "$SUDO_USER"
fi
#################################
## RSSから最新のバージョンを取得する
STR_RSS_URL="https://www.dropboxforum.com/mxpez29397/rss/board?board.id=101003016"
XML_RSS_DATA=$(/usr/bin/curl -s "$STR_RSS_URL" | xmllint --format -)
STR_TITLE=$(echo "$XML_RSS_DATA" | xmllint --xpath "//item/title/text()" -)
IFS=$'\n' read -r -d '' -a LIST_TITLE <<<"$STR_TITLE"

for ITEM_TITLE in "${LIST_TITLE[@]}"; do
  if [[ $ITEM_TITLE == *"Stable"* ]]; then
  /bin/echo "$ITEM_TITLE"
    read -ra ARRAY_TITLE <<<"$ITEM_TITLE"
    STR_VERSION=${ARRAY_TITLE[2]}
  /bin/echo "$STR_VERSION"
    break
  fi
done
#################################
##URLを生成する
STR_BASE_URL="https://edge.dropboxstatic.com/dbx-releng/client/"
###CPUタイプでの分岐
ARCHITEC=$(/usr/bin/arch)
if [ "$ARCHITEC" == "arm64" ]; then
STR_DMG_FILE_NAME="Dropbox%20$STR_VERSION.arm64.dmg"
DL_FILE_NAME="Dropbox $STR_VERSION.arm64.dmg"
STR_URL="$STR_BASE_URL$STR_DMG_FILE_NAME"
else
STR_DMG_FILE_NAME="Dropbox%20$STR_VERSION.dmg" 
DL_FILE_NAME="Dropbox $STR_VERSION.dmg"
STR_URL="$STR_BASE_URL$STR_DMG_FILE_NAME"
fi
  /bin/echo "$STR_URL"
#################################
##ダウンロード
LOCAL_TMP_DIR=$(/usr/bin/sudo -u "$SUDO_USER" /usr/bin/mktemp -d)
/bin/echo "TMPDIR:" "$LOCAL_TMP_DIR"

if [ "$ARCHITEC" == "arm64" ]; then
  /bin/echo "Running on $ARCHITEC"
  ###ダウンロード
  if ! /usr/bin/curl -L -o "$LOCAL_TMP_DIR/$DL_FILE_NAME" "$STR_URL" --connect-timeout 20; then
    /bin/echo "ファイルのダウンロードに失敗しました HTTP1.1で再トライします"
    if ! /usr/bin/curl -L -o "$LOCAL_TMP_DIR/$DL_FILE_NAME" "$STR_URL" --http1.1 --connect-timeout 20; then
      /bin/echo "ファイルのダウンロードに失敗しました"
      exit 1
    fi
  fi
else
  /bin/echo "Running on $ARCHITEC"
  ###ダウンロード
  if ! /usr/bin/curl -L -o "$LOCAL_TMP_DIR/$DL_FILE_NAME" "$STR_URL" --connect-timeout 20; then
    /bin/echo "ファイルのダウンロードに失敗しました HTTP1.1で再トライします"
    if ! /usr/bin/curl -L -o "$LOCAL_TMP_DIR/$DL_FILE_NAME" "$STR_URL" --http1.1 --connect-timeout 20; then
      /bin/echo "ファイルのダウンロードに失敗しました"
      exit 1
    fi
  fi
fi
#################################
###プロセス終了
STR_APP_NAME="Dropbox.app"
###
STR_PLIST_PATH="/Applications/$STR_APP_NAME/Contents/Info.plist"
STR_BUNDLE_ID=$(/usr/bin/defaults read "$STR_PLIST_PATH" CFBundleIdentifier)
/bin/echo "STR_BUNDLE_ID" "$STR_BUNDLE_ID"
##念の為 KILLもする
/usr/bin/killall "Dropbox" 2>/dev/null
/usr/bin/killall "Dropbox Helper" 2>/dev/null
/usr/bin/killall "Dropbox Helper (Renderer)" 2>/dev/null
/usr/bin/killall "Dropbox Helper (Plugin)" 2>/dev/null
/usr/bin/killall "Dropbox Helper (GPU)" 2>/dev/null
/usr/bin/killall "DropboxActivityProvider" 2>/dev/null
/usr/bin/killall "DropboxFileProviderCH" 2>/dev/null
/usr/bin/killall "DropboxFileProvider" 2>/dev/null
/usr/bin/killall "DropboxTransferExtension" 2>/dev/null
/bin/echo "アプリケーション終了"
/bin/sleep 2

#################################
  function DO_MOVE_TO_TRASH() {
    if [ -e "$1" ]; then
      TRASH_DIR=$(/usr/bin/sudo -u "$SUDO_USER" /usr/bin/mktemp -d "/var/folders/TemporaryItems/XXXXXXXX")
      /usr/bin/sudo /bin/chmod 777 "$TRASH_DIR"
      /usr/bin/sudo /bin/mv "$1" "$TRASH_DIR"
      ##削除
      /usr/bin/sudo /usr/bin/find "$TRASH_DIR" -mindepth 1 -delete
    fi
}
#####古いファイルをゴミ箱に LOCAL
DO_MOVE_TO_TRASH "/Library/DropboxHelperTools"
DO_MOVE_TO_TRASH "/Applications/Dropbox.app"
DO_MOVE_TO_TRASH "/Users/$SUDO_USER/Library/Dropbox"
DO_MOVE_TO_TRASH "/Users/$SUDO_USER/Library/HTTPStorages/com.dropbox.DropboxMacUpdate"
DO_MOVE_TO_TRASH "/Users/$SUDO_USER/Library/HTTPStorages/com.getdropbox.dropbox"
#################################
/usr/bin/hdiutil attach  "$LOCAL_TMP_DIR/$DL_FILE_NAME" -noverify -nobrowse -noautoopen


###########この方法だとサイレントにならない
#/usr/bin/sudo "/Volumes/Dropbox Offline Installer/Dropbox.app/Contents/MacOS/Dropbox" - nolaunch

/usr/bin/ditto "/Volumes/Dropbox Offline Installer/Dropbox.app" "/Applications/Dropbox.app"

/usr/bin/hdiutil detach "/Volumes/Dropbox Offline Installer" -force

###ここは好みの問題か?
/usr/bin/sudo  chown -Rf root "/Applications/Dropbox.app"
#/usr/bin/sudo chown -Rf "$SUDO_USER" "/Applications/Dropbox.app"

###実行はユーザーにまかせるのもあり?
##/usr/bin/sudo "/Applications/Dropbox.app/Contents/MacOS/Dropbox" - nolaunch
##/usr/bin/sudo -u "$SUDO_USER" "/Applications/Dropbox.app/Contents/MacOS/Dropbox" - nolaunch

exit 0




|

[Dropbox]サインレト・インストール(途中)

コマンド的には
set theComandText to ("\"/Volumes/Dropbox Offline Installer/Dropbox.app/Contents/MacOS/Dropbox\" - nolaunch") as text
do shell script theComandText

なんだろうけど… Acrobatと同様にパスワードを要求してくるので、完全サイレントとはいかない dittoした方がいいのだろうか?

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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#https://www.dropboxforum.com/t5/Dropbox-desktop-client-builds/bd-p/101003016
#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
##########################
## 最新のバージョン取得
##########################
##RSSのURL
set strRssURL to "https://www.dropboxforum.com/mxpez29397/rss/board?board.id=101003016" as text
set ocidRssURL to refMe's NSURL's URLWithString:(strRssURL)
###XML読み込み
set ocidOption to refMe's NSXMLDocumentTidyXML
set listXmlDoc to refMe's NSXMLDocument's alloc()'s initWithContentsOfURL:(ocidRssURL) options:(ocidOption) |error|:(reference)
set ocidReadXMLDoc to (item 1 of listXmlDoc)
###ROOT
set ocidRootElement to ocidReadXMLDoc's rootElement()
set numChild to (count of ocidRootElement's children) as integer
###第一階層 channel
set ocidChannel to (ocidRootElement's childAtIndex:0)
set numChild to (count of ocidChannel's children) as integer
###子要素の数だけ繰り返し
repeat with numCntChild from 0 to (numChild - 1)
  set strChldName to (ocidChannel's childAtIndex:numCntChild)'s |name| as text
  ####要素名がitemなら
  if strChldName is "item" then
    ###itemのtitleをテキストで取得して
    set ocidItemObject to ((ocidChannel's childAtIndex:numCntChild)'s childAtIndex:0)
    set ocidTitle to ocidItemObject's stringValue()
    ###最初のStable項目=最新
    if (ocidTitle as text) contains "Stable" then
      set ocidTitleArray to (ocidTitle's componentsSeparatedByString:(" "))
      ###バージョンテキストを取得したらリピート終了
      set strVersion to (ocidTitleArray's lastObject()) as text
      exit repeat
    end if
  end if
end repeat
###取得したバージョン番号
log strVersion
##########################
## ダウンロードするURLを生成
##########################
##CPUタイプのよる処理の分岐
set objSysInfo to system info
set theCpuType to (CPU type of objSysInfo) as text

if theCpuType contains "Intel" then
  # set strURL to "https://www.dropbox.com/downloading?plat=mac&type=full"
  set strFileName to "Dropbox " & strVersion & ".dmg" as text
  # set strURL to ("https://edge.dropboxstatic.com/dbx-releng/client/" & strFileName & "") as text
else
  #set strURL to "https://www.dropbox.com/downloading?plat=mac&type=full&arch=arm64"
  set strFileName to "Dropbox " & strVersion & ".arm64.dmg" as text
  #set strURL to ("https://edge.dropboxstatic.com/dbx-releng/client/" & strFileName & "") as text
end if
####ダウンロードするDMGファイル名とURLが確定
set ocidURL to refMe's NSURL's alloc()'s initWithString:("https://edge.dropboxstatic.com/dbx-releng/client/")
##ファイル名
set ocidURL to ocidURL's URLByAppendingPathComponent:(strFileName)
set strURL to ocidURL's absoluteString() as text
log strURL as text

##########################
## ダウンロードするファイル
##########################
###テンポラリ
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidTemporaryDirPathURL to appFileManager's temporaryDirectory
set ocidTemporaryItemsPathURL to ocidTemporaryDirPathURL's URLByAppendingPathComponent:("TemporaryItems")
###同一パスにならないようにUUIDを足す
set ocidUUID to refMe's NSUUID's alloc()'s init()
set coidUUID to ocidUUID's UUIDString()
set ocidLocalUUIDPathURL to ocidTemporaryItemsPathURL's URLByAppendingPathComponent:(coidUUID)
###DMG保存ディレクトリ
set ocidAttrDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
ocidAttrDict's setValue:(511) forKey:(refMe's NSFilePosixPermissions)
appFileManager's createDirectoryAtURL:(ocidLocalUUIDPathURL) withIntermediateDirectories:(true) attributes:(ocidAttrDict) |error|:(reference)
###ファイル名を足してDMGの保存パス
set ocidLocalPathURL to ocidLocalUUIDPathURL's URLByAppendingPathComponent:(strFileName)
set strLocalPath to (ocidLocalPathURL's |path|) as text
##########################
## ダウンロード
##########################
try
  set strCommandText to ("/usr/bin/curl -L -o \"" & strLocalPath & "\"   \"" & strURL & "\" --connect-timeout 10") as text
  do shell script strCommandText
on error
  set strCommandText to ("/usr/bin/curl -L -o \"" & strLocalPath & "\"   \"" & strURL & "\" --http1.1 --connect-timeout 10") as text
  do shell script strCommandText
end try

##########################
## 関連プロセス終了
##########################
set listBundleID to {"com.dropbox.Electron.helper", "com.getdropbox.dropbox"}

repeat with itemUTI in listBundleID
  ###NSRunningApplication
  set ocidRunningApplication to refMe's NSRunningApplication
  ###起動中のすべてのリスト
  set ocidAppArray to (ocidRunningApplication's runningApplicationsWithBundleIdentifier:(itemUTI))
  ###複数起動時も順番に終了
  repeat with itemAppArray in ocidAppArray
itemAppArray's terminate()
  end repeat
end repeat

##########################
## 関連プロセス終了
##########################
try
  tell application id "com.getdropbox.dropbox" to quit
end try
try
  do shell script "killall \"Dropbox Helper\""
  do shell script "killall \"Dropbox Helper (Renderer)\""
  do shell script "killall \"Dropbox Helper (Plugin)\""
  do shell script "killall \"Dropbox Helper (GPU)\""
  do shell script "killall \"Dropbox\""
  do shell script "killall \"DropboxActivityProvider\""
  do shell script "killall \"DropboxFileProviderCH\""
  do shell script "killall \"DropboxFileProvider\""
  do shell script "killall \"DropboxTransferExtension\""
end try
##########################
## 本処理
##########################
##appNSWorkspaceでドライブを表示しないマウント方法がわからない
set theComandText to ("/usr/bin/hdiutil attach \"" & strLocalPath & "\" -noverify -nobrowse -noautoopen\n") as text
do shell script theComandText



set theComandText to ("\"/Volumes/Dropbox Offline Installer/Dropbox.app/Contents/MacOS/Dropbox\" - nolaunch") as text
do shell script theComandText


delay 10

##########################
## アンマウント
##########################
set strDiskPath to "/Volumes/Dropbox Offline Installer"
set ocidDiskPathStr to refMe's NSString's stringWithString:(strDiskPath)
set ocidDiskPath to ocidDiskPathStr's stringByExpandingTildeInPath()
set ocidDiskPathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidDiskPath) isDirectory:false)
set appNSWorkspace to refMe's NSWorkspace's sharedWorkspace()
(appNSWorkspace's unmountAndEjectDeviceAtURL:(ocidDiskPathURL) |error|:(reference))
try
  set theComandText to ("/usr/bin/hdiutil detach \"" & strDiskPath & "\" -force") as text
  do shell script theComandText
end try



|

[CloudStorage]クラウドドライブを開く

複数アカウントに対応した
CloudStorageの複数アカウントは
『サービス名』-『アカウント名』となっている
OneDriveなら
OneDrive-個人用 OneDrive-企業名 OneDrive-組織名
GoogleDriveなら
GoogleDrive-メールアドレス
Boxなら
Box-Boxが個人用 Box-アカウント名が組織用



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

#!/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 strDriveName to "GoogleDrive" as text
(*
set strDriveName to "Box"
set strDriveName to "OneDrive"
set strDriveName to "DropBox"
set strDriveName to "GoogleDrive"
*)


set appFileManager to refMe's NSFileManager's defaultManager()
set appShardWorkspace to refMe's NSWorkspace's sharedWorkspace()

###################################
#####パス
###################################
set ocidHomeDirUrl to appFileManager's homeDirectoryForCurrentUser()
set ocidCloudStorageDirURL to ocidHomeDirUrl's URLByAppendingPathComponent:"Library/CloudStorage"

###################################
#####複数アカウントあるか調べる
###################################
###プロパティ設定
set ocidPropertieKey to {(refMe's NSURLPathKey), (refMe's NSURLIsDirectoryKey)}
###オプション設定
set ocidOption to refMe's NSDirectoryEnumerationSkipsHiddenFiles
###ディレクトリのコンテンツを取得(第一階層のみ)
set listPathUrlArray to (appFileManager's contentsOfDirectoryAtURL:ocidCloudStorageDirURL includingPropertiesForKeys:ocidPropertieKey options:ocidOption |error|:(reference))
###Arrayに格納
set ocidPathUrlArray to item 1 of listPathUrlArray
###パス格納用のArrayを作って
set ocidPathArray to (refMe's NSMutableArray's arrayWithCapacity:0)
####コンテンツの数だけ繰り返し
repeat with itemPathUrlArray in ocidPathUrlArray
  ###最後のパスを取得して
  set ocidLastPathName to itemPathUrlArray's lastPathComponent()
  ###テキストに
  set strLastPathName to ocidLastPathName as text
  ###最後のパスにBoxが含まれていたら
  if strLastPathName starts with strDriveName then
    ###Arrayに格納
    (ocidPathArray's addObject:itemPathUrlArray)
  end if
end repeat
###################################
#####複数アカウント時
###################################
set numCntArray to (ocidPathArray count) as integer
#####アカウント数0
if numCntArray = 0 then
  return "CloudStorageに対象のアカウントがありません。ソフトウェアをアップデートしてください"
  ####アカウント数1
else if numCntArray = 1 then
  set ocidFilePathURL to ocidPathArray's objectAtIndex:0
  set aliasFilePathURL to ocidFilePathURL as alias
  set boolResults to (appShardWorkspace's openURL:ocidFilePathURL)
  if boolResults is false then
    tell application "Finder"
      make new Finder window to aliasFilePathURL
    end tell
  end if
  return "処理終了"
else
  ####複数アカウント
  set listDirName to {} as list
  repeat with itemPathArray in ocidPathArray
    set strDirName to (itemPathArray's lastPathComponent()) as text
    copy strDirName to end of listDirName
  end repeat
  ####ダイアログを前面に出す
  tell current application
    set strName to name as text
  end tell
  ####スクリプトメニューから実行したら
  if strName is "osascript" then
    tell application "Finder"
      activate
    end tell
  else
    tell current application
      activate
    end tell
  end if
  try
    set listResponse to (choose from list listDirName with title "選んでください" with prompt "開くフォルダを選んでください" default items (item 1 of listDirName) OK button name "OK" cancel button name "キャンセル" without multiple selections allowed and empty selection allowed)
    log class of listResponse
  on error
    log "エラーしました"
    return "エラーしました"
  end try
  if listResponse is false then
    return "キャンセルしました"
  end if
  set itemPathArray to (item 1 of listResponse) as text
  set ocidCloudStorageDirURL to ocidCloudStorageDirURL's URLByAppendingPathComponent:strDirName
end if

###################################
#####開く
###################################
repeat with itemPathArray in ocidPathArray
  set aliasFilePathURL to itemPathArray as alias
  set boolResults to (appShardWorkspace's openURL:itemPathArray)
  if boolResults is false then
    tell application "Finder"
      make new Finder window to aliasFilePathURL
    end tell
  end if
end repeat

return "選択オープン処理終了"





|

[DropBox]DropBoxフォルダへバックアップしたいフォルダをコピーする

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

#!/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 ocidHomeDirUrl to appFileManager's homeDirectoryForCurrentUser()
set ocidDesktopDirURL to ocidHomeDirUrl's URLByAppendingPathComponent:"Desktop"
set aliasDesktopDirURL to ocidDesktopDirURL as alias
###ダイアログテキスト
set strPromptText to "入力フォルダを選んでください"
set strPromptMes to "入力フォルダを選んでください"
try
  set listResponse to (choose folder strPromptMes with prompt strPromptText default location aliasDesktopDirURL with invisibles and showing package contents without multiple selections allowed) as list
on error
  log "エラーしました"
  return
end try
set aliasCopyDirPath to (item 1 of listResponse) as alias
###################################
#####コピー先フォルダ
###################################
set ocidDropBoxDirURL to ocidHomeDirUrl's URLByAppendingPathComponent:"Library/CloudStorage/Dropbox"
set aliasDropBoxDirURL to ocidDropBoxDirURL as alias
###ダイアログテキスト
set strPromptText to "コピー先フォルダを選んでください"
set strPromptMes to "コピー先フォルダを選んでください"
try
  set listDistResponse to (choose folder strPromptMes with prompt strPromptText default location aliasDropBoxDirURL with invisibles and showing package contents without multiple selections allowed) as list
on error
  log "エラーしました"
  return
end try
set aliasDistDirPath to (item 1 of listDistResponse) as alias


###################################
#####コマンド実行
###################################
###dittoコマンドの特性に合わせてパスを調整
###入力パスから最後のディレクトリ名を取得して
set strCopyDirPath to POSIX path of aliasCopyDirPath as text
set ocidCopyDirPathStr to refMe's NSString's stringWithString:strCopyDirPath
set ocidCopyDirPath to ocidCopyDirPathStr's stringByStandardizingPath()
set ocidLastDirName to ocidCopyDirPath's lastPathComponent()
####出力先パスの最後に加える
set strDistDirPath to POSIX path of aliasDistDirPath as text
set ocidDistDirPathStr to refMe's NSString's stringWithString:strDistDirPath
set ocidDistDirPath to ocidDistDirPathStr's stringByStandardizingPath()
set ocidDistDirPath to ocidDistDirPath's stringByAppendingPathComponent:ocidLastDirName
set strDistDirPathStr to ocidDistDirPath as text


set strCommandText to "/usr/bin/ditto \"" & strCopyDirPath & "\" \"" & strDistDirPathStr & "\"" as text
do shell script strCommandText



|

[DropBox]デスクトップにDropBoxのエイリアスをアイコン付きで作成する

ダウンロード - dropboxicon.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

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

####################################
###ドコ?に作る?
set strAddAliasFilePath to "~/Desktop/Dropbox" as text
###元ファイルは?
set strOrgFilePath to "~/Library/CloudStorage/Dropbox" as text
###アイコンどうする?
set boolSetIcon to true as boolean

if boolSetIcon is true then
  set strIconFilePath to "/Applications/Dropbox.app/Contents/Resources/AppIcon.icns" as text
end if

####################################
####エイリアスが作られる場所
set ocidAddAliasFilePathStr to refMe's NSString's stringWithString:strAddAliasFilePath
set ocidAddAliasFilePath to ocidAddAliasFilePathStr's stringByStandardizingPath
set ocidAddAliasFilePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:ocidAddAliasFilePath isDirectory:false
set strAddAliasFilePathURL to ocidAddAliasFilePathURL's |path|() as text

###ディレクトリを作る必要があれば作る
set ocidAddAliasDirFilePathURL to ocidAddAliasFilePathURL's URLByDeletingLastPathComponent()
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:(ocidAddAliasDirFilePathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error|:(reference)

####################################
####エイリアスの元ファイル
####################################
set ocidFilePathStr to refMe's NSString's stringWithString:strOrgFilePath
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath
set ocidFilePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:ocidFilePath isDirectory:false

####################################
#### エイリアスを作る
####################################
set listBookMarkNSData to (ocidFilePathURL's bookmarkDataWithOptions:(refMe's NSURLBookmarkCreationSuitableForBookmarkFile) includingResourceValuesForKeys:{refMe's NSURLCustomIconKey} relativeToURL:(missing value) |error|:(reference))
set ocdiBookMarkData to (item 1 of listBookMarkNSData)
set listResults to (refMe's NSURL's writeBookmarkData:ocdiBookMarkData toURL:ocidAddAliasFilePathURL options:(refMe's NSURLBookmarkCreationSuitableForBookmarkFile) |error|:(reference))

####################################
#### アイコンを付与
####################################
if boolSetIcon is true then
  tell application "Finder"
    set aliasIconFilePath to (path to me) as alias
    set aliiasContainerDirPath to container of aliasIconFilePath as alias
  end tell
  set strIconPath to (POSIX path of aliiasContainerDirPath) as text
  set strBinPath to (strIconPath & "bin/seticon") as text
  set strCommandText to ("\"" & strBinPath & "\" \"" & strIconFilePath & "\" \"" & strAddAliasFilePathURL & "\"") as text
  do shell script strCommandText
end if

return

|

その他のカテゴリー

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