Admin Maintenance

Containersクリーナー


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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
(*
com.cocolog-nifty.quicktimer.icefloe
Containersの全フォルダ対象で
Caches
Application Scripts
HTTPStorages
Saved Application State
Logs
の内包物をゴミ箱に入れます
*)
----+----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

property refNSNotFound : a reference to 9.22337203685477E+18 + 5807
set ocidFalse to (refMe's NSNumber's numberWithBool:false)
set ocidTrue to (refMe's NSNumber's numberWithBool:true)

set appFileManager to refMe's NSFileManager's defaultManager()
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSLibraryDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidLibraryDirPathURL to ocidURLsArray's firstObject()
##################################
###Logs 
set ocidTargetDirPathURL to ocidLibraryDirPathURL's URLByAppendingPathComponent:("Logs")
##プロパティ
set ocidPropertieKeyArray to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
ocidPropertieKeyArray's addObject:(refMe's NSURLPathKey)
ocidPropertieKeyArray's addObject:(refMe's NSURLIsDirectoryKey)
##オプション(隠しファイルは含まない)
set ocidOption to refMe's NSDirectoryEnumerationSkipsHiddenFiles
####ディレクトリのコンテツを収集
set ocidEnuDict to (appFileManager's enumeratorAtURL:(ocidTargetDirPathURL) includingPropertiesForKeys:(ocidPropertieKeyArray) options:(ocidOption) errorHandler:(reference))
repeat
  set ocidEnuURL to ocidEnuDict's nextObject()
  if ocidEnuURL = (missing value) then
    exit repeat
  else
    set listResult to (ocidEnuURL's getResourceValue:(reference) forKey:(refMe's NSURLIsRegularFileKey) |error|:(reference))
    set boolIsValue to (item 2 of listResult)
    ##ファイルならゴミ箱にここはファイルのみ削除する(どうせまたできるからね)
    if boolIsValue = ocidTrue then
      set listDone to (appFileManager's trashItemAtURL:(ocidEnuURL) resultingItemURL:(ocidEnuURL) |error|:(reference))
      if (item 2 of listDone) ≠ (missing value) then
log (item 2 of listDone)'s localizedDescription() as text
      end if
    end if
  end if
end repeat


##################################
###Containersクリーナー
set ocidTargetDirPathURL to ocidLibraryDirPathURL's URLByAppendingPathComponent:("Containers")
##################################
###URLを格納するリスト
set ocidFilePathURLAllArray to (refMe's NSMutableArray's alloc()'s initWithCapacity:0)
##プロパティ
set ocidPropertieKeyArray to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
ocidPropertieKeyArray's addObject:(refMe's NSURLPathKey)
ocidPropertieKeyArray's addObject:(refMe's NSURLIsDirectoryKey)
##オプション(隠しファイルは含まない)
set ocidOption to refMe's NSDirectoryEnumerationSkipsHiddenFiles
####ディレクトリのコンテツを収集
set listResponse to (appFileManager's contentsOfDirectoryAtURL:(ocidTargetDirPathURL) includingPropertiesForKeys:(ocidPropertieKeyArray) options:(ocidOption) |error|:(reference))
set ocidURLArray to (item 1 of listResponse)

######Caches
repeat with itemURL in ocidURLArray
  set ocidCachesDirPathURL to (itemURL's URLByAppendingPathComponent:("Data/Library/Caches") isDirectory:(true))
  set listResponse to (appFileManager's contentsOfDirectoryAtURL:(ocidCachesDirPathURL) includingPropertiesForKeys:(ocidPropertieKeyArray) options:(ocidOption) |error|:(reference))
  set ocidSubURLArray to (item 1 of listResponse)
  if ocidSubURLArray ≠ (missing value) then
    repeat with itemSubURL in ocidSubURLArray
      set listDone to (appFileManager's trashItemAtURL:(itemSubURL) resultingItemURL:(itemSubURL) |error|:(reference))
      if (item 2 of listDone) ≠ (missing value) then
log (item 2 of listDone)'s localizedDescription() as text
      end if
    end repeat
  end if
end repeat

######tmp
repeat with itemURL in ocidURLArray
  set ocidCachesDirPathURL to (itemURL's URLByAppendingPathComponent:("Data/tmp") isDirectory:(true))
  set listResponse to (appFileManager's contentsOfDirectoryAtURL:(ocidCachesDirPathURL) includingPropertiesForKeys:(ocidPropertieKeyArray) options:(ocidOption) |error|:(reference))
  set ocidSubURLArray to (item 1 of listResponse)
  if ocidSubURLArray ≠ (missing value) then
    repeat with itemSubURL in ocidSubURLArray
      set listDone to (appFileManager's trashItemAtURL:(itemSubURL) resultingItemURL:(itemSubURL) |error|:(reference))
      if (item 2 of listDone) ≠ (missing value) then
log (item 2 of listDone)'s localizedDescription() as text
      end if
    end repeat
  end if
end repeat

######log
repeat with itemURL in ocidURLArray
  set ocidCachesDirPathURL to (itemURL's URLByAppendingPathComponent:("Data/Library/Logs") isDirectory:(true))
  set listResponse to (appFileManager's contentsOfDirectoryAtURL:(ocidCachesDirPathURL) includingPropertiesForKeys:(ocidPropertieKeyArray) options:(ocidOption) |error|:(reference))
  set ocidSubURLArray to (item 1 of listResponse)
  if ocidSubURLArray ≠ (missing value) then
    repeat with itemSubURL in ocidSubURLArray
      set listDone to (appFileManager's trashItemAtURL:(itemSubURL) resultingItemURL:(itemSubURL) |error|:(reference))
      if (item 2 of listDone) ≠ (missing value) then
log (item 2 of listDone)'s localizedDescription() as text
      end if
    end repeat
  end if
end repeat

######Saved Application State
repeat with itemURL in ocidURLArray
  set ocidCachesDirPathURL to (itemURL's URLByAppendingPathComponent:("Data/Library/Saved Application State") isDirectory:(true))
  set listResponse to (appFileManager's contentsOfDirectoryAtURL:(ocidCachesDirPathURL) includingPropertiesForKeys:(ocidPropertieKeyArray) options:(ocidOption) |error|:(reference))
  set ocidSubURLArray to (item 1 of listResponse)
  if ocidSubURLArray ≠ (missing value) then
    repeat with itemSubURL in ocidSubURLArray
      set listDone to (appFileManager's trashItemAtURL:(itemSubURL) resultingItemURL:(itemSubURL) |error|:(reference))
      if (item 2 of listDone) ≠ (missing value) then
log (item 2 of listDone)'s localizedDescription() as text
      end if
    end repeat
  end if
end repeat

######Application Scripts
repeat with itemURL in ocidURLArray
  set ocidCachesDirPathURL to (itemURL's URLByAppendingPathComponent:("Data/Library/Application Scripts") isDirectory:(true))
  set listResponse to (appFileManager's contentsOfDirectoryAtURL:(ocidCachesDirPathURL) includingPropertiesForKeys:(ocidPropertieKeyArray) options:(ocidOption) |error|:(reference))
  set ocidSubURLArray to (item 1 of listResponse)
  if ocidSubURLArray ≠ (missing value) then
    repeat with itemSubURL in ocidSubURLArray
      set listDone to (appFileManager's trashItemAtURL:(itemSubURL) resultingItemURL:(itemSubURL) |error|:(reference))
      if (item 2 of listDone) ≠ (missing value) then
log (item 2 of listDone)'s localizedDescription() as text
      end if
    end repeat
  end if
end repeat


######HTTPStorages
repeat with itemURL in ocidURLArray
  set ocidCachesDirPathURL to (itemURL's URLByAppendingPathComponent:("Data/Library/Application Scripts") isDirectory:(true))
  set listResponse to (appFileManager's contentsOfDirectoryAtURL:(ocidCachesDirPathURL) includingPropertiesForKeys:(ocidPropertieKeyArray) options:(ocidOption) |error|:(reference))
  set ocidSubURLArray to (item 1 of listResponse)
  if ocidSubURLArray ≠ (missing value) then
    repeat with itemSubURL in ocidSubURLArray
      set listDone to (appFileManager's trashItemAtURL:(itemSubURL) resultingItemURL:(itemSubURL) |error|:(reference))
      if (item 2 of listDone) ≠ (missing value) then
log (item 2 of listDone)'s localizedDescription() as text
      end if
    end repeat
  end if
end repeat

|

[bash]全てのローカルアカウントのゴミ箱をからにする

ダウンロード - 全ユーザーゴミ箱空に.zip


実行ユーザーの実行環境による違いに対応するのに苦労した

1:Jamf等を利用して実行する
2:ターミナルから実行
3:Applescriptで実行(do shell script)
4:リモートログインからのシェル利用
5:Payload-Free Installer Packageなんかでも使える構文だと思うけどどうかな?
UI利用だとdo shell scriptは指紋認証使えるので超便利

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

#!/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 で実行してください"
  exit 1
else
  ###実行しているユーザー名
  SUDO_USER=$(/bin/echo "$HOME" | /usr/bin/awk -F'/' '{print $NF}')
  /bin/echo "実行ユーザー:" "$SUDO_USER"
fi

###コンソールユーザーにのみ処理する
CONSOLE_USER=$(/bin/echo "show State:/Users/ConsoleUser" | /usr/sbin/scutil | /usr/bin/awk '/Name :/ { print $3 }')
/bin/echo "CONSOLE_USER:$CONSOLE_USER"
if [ -z "$CONSOLE_USER" ]; then
  /bin/echo "コンソールユーザーが無い=電源入れてログインウィンドウ状態"
else
  /bin/echo "コンソールユーザーに対しての処理"
  ###エラーよけにゴミ箱に削除する物を作っておく
  /usr/bin/sudo -u "$CONSOLE_USER"  /usr/bin/touch "/Users/$CONSOLE_USER/.Trash/ForEmptyTrash.tmp"
  ##この1秒がないとゴミ箱がすでに空の場合にエラーが出る
  /bin/sleep 1
  ###ゴミ箱からに
  /usr/bin/sudo -u "$CONSOLE_USER" /usr/bin/osascript -e "tell application id \"com.apple.Finder\" to  empty the trash"
fi

########################################
###ローカルのユーザーアカウントを取得
TEXT_RESULT=$(/usr/bin/dscl localhost -list /Local/Default/Users PrimaryGroupID | /usr/bin/awk '$2 == 20 { print $1 }')

###リストにする
read -d '\\n' -r -a LIST_USER <<<"$TEXT_RESULT"

###リスト内の項目数
NUM_CNT=${#LIST_USER[@]}
/bin/echo "ユーザー数:" "$NUM_CNT"
########################################
##リストの内容を順番に処理
for ITEM_LIST in "${LIST_USER[@]}"; do
  /bin/echo "LIST_USER:MKDIR:" "${ITEM_LIST}"
  if [ "$SUDO_USER" == "root" ]; then
    ###ユーザーチェンジして
    /usr/bin/su - "${ITEM_LIST}"
  fi
  ##ゴミ箱の中を空にする
  /usr/bin/sudo -u "${ITEM_LIST}" /usr/bin/find "/Users/${ITEM_LIST}/.Trash" -mindepth 1 -delete
  ##ルートに戻す
  if [ "$SUDO_USER" == "root" ]; then
    ###ユーザーチェンジして
    /usr/bin/su - root
  fi

done

/bin/echo "処理終了しました"

exit 0

|

[Logs]ローカルログファイルで削除可能なログファイルを削除

アクセス権のないファイルは削除しない(非管理者ユーザー用)

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

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


####################################
####対象ディレクトリ
####################################
####ライブラリーのURL
set ocidLibraryURLArray to (appFileManager's URLsForDirectory:(refMe's NSLibraryDirectory) inDomains:(refMe's NSLocalDomainMask))
set ocidUserLibraryURL to ocidLibraryURLArray's objectAtIndex:0
set ocidLogDirPathURL to (ocidUserLibraryURL's URLByAppendingPathComponent:"Logs" isDirectory:true)

##############################################
##準備
##############################################
###enumeratorAtURL用のBoolean
set ocidFalse to (refMe's NSNumber's numberWithBool:false)
set ocidTrue to (refMe's NSNumber's numberWithBool:true)
###enumeratorAtURLL格納用のレコード
set ocidEmuDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
###enumeratorAtURLL格納するリスト
set ocidEmuFileURLArray to refMe's NSMutableArray's alloc()'s initWithCapacity:0
###ファイルURLのみを格納するリスト
set ocidFilePathURLArray to refMe's NSMutableArray's alloc()'s initWithCapacity:0

##############################################
##ディレクトリのコンテツを収集
##############################################
###収集する付随プロパティ
set ocidPropertiesForKeys to {refMe's NSURLIsRegularFileKey}
####ディレクトリのコンテツを収集
set ocidEmuDict to (appFileManager's enumeratorAtURL:ocidLogDirPathURL includingPropertiesForKeys:ocidPropertiesForKeys options:(refMe's NSDirectoryEnumerationSkipsHiddenFiles) errorHandler:(reference))
###戻り値用のリストに格納
set ocidEmuFileURLArray to ocidEmuDict's allObjects()

##############################################
##『ファイル』だけ取り出したリストにする
##############################################

####enumeratorAtURLのかずだけ繰り返し
repeat with itemEmuFileURL in ocidEmuFileURLArray
  ####URLforKeyで取り出し
  set listResult to (itemEmuFileURL's getResourceValue:(reference) forKey:(refMe's NSURLIsRegularFileKey) |error|:(reference))
  ###リストからNSURLIsRegularFileKeyBOOLを取り出し
  set boolIsRegularFileKey to item 2 of listResult
  ####ファイルのみを(ディレクトリやリンボリックリンクは含まない)
  if boolIsRegularFileKey is ocidTrue then
    ####リストにする
    (ocidFilePathURLArray's addObject:itemEmuFileURL)
  end if
end repeat

###解放
set ocidEmuFileURLArray to ""
set ocidEmuDict to ""


##############################################
##ゴミ箱に入れる
##############################################

repeat with itemFilePathURL in ocidFilePathURLArray
  
  log itemFilePathURL's |path|() as text
  ####ゴミ箱
  set listResult to (appFileManager's trashItemAtURL:itemFilePathURL resultingItemURL:(missing value) |error|:(reference))
  
end repeat

|

[Logs]ユーザーログファイルを全部ゴミ箱へ(修正)

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

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

(*
Chromeエンジン使っているアプリは終了させてから実行しないと
chrome_crashpadがログを書き込めなくなるので
恐ろしい数のエラーが出ます。
*)
###Chromeエンジン使っているアプリは終了させてから
tell application id "com.google.Chrome" to quit
tell application id "com.microsoft.VSCode" to quit
###終了を待つ
delay 5
####################################
####対象ディレクトリ
####################################
####ライブラリーのURL
set ocidLibraryURLArray to (appFileManager's URLsForDirectory:(refMe's NSLibraryDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidUserLibraryURL to ocidLibraryURLArray's objectAtIndex:0
set ocidLogDirPathURL to (ocidUserLibraryURL's URLByAppendingPathComponent:"Logs" isDirectory:true)

##############################################
##準備
##############################################
###enumeratorAtURL用のBoolean
set ocidFalse to (refMe's NSNumber's numberWithBool:false)
set ocidTrue to (refMe's NSNumber's numberWithBool:true)
###enumeratorAtURLL格納用のレコード
set ocidEmuDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
###enumeratorAtURLL格納するリスト
set ocidEmuFileURLArray to refMe's NSMutableArray's alloc()'s initWithCapacity:0
###ファイルURLのみを格納するリスト
set ocidFilePathURLArray to refMe's NSMutableArray's alloc()'s initWithCapacity:0

##############################################
##ディレクトリのコンテツを収集
##############################################
###収集する付随プロパティ
set ocidPropertiesForKeys to {refMe's NSURLIsRegularFileKey}
####ディレクトリのコンテツを収集
set ocidEmuDict to (appFileManager's enumeratorAtURL:ocidLogDirPathURL includingPropertiesForKeys:ocidPropertiesForKeys options:(refMe's NSDirectoryEnumerationSkipsHiddenFiles) errorHandler:(reference))
###戻り値用のリストに格納
set ocidEmuFileURLArray to ocidEmuDict's allObjects()

##############################################
##『ファイル』だけ取り出したリストにする
##############################################

####enumeratorAtURLのかずだけ繰り返し
repeat with itemEmuFileURL in ocidEmuFileURLArray
  ####URLforKeyで取り出し
  set listResult to (itemEmuFileURL's getResourceValue:(reference) forKey:(refMe's NSURLIsRegularFileKey) |error|:(reference))
  ###リストからNSURLIsRegularFileKeyBOOLを取り出し
  set boolIsRegularFileKey to item 2 of listResult
  ####ファイルのみを(ディレクトリやリンボリックリンクは含まない)
  if boolIsRegularFileKey is ocidTrue then
    ####リストにする
    (ocidFilePathURLArray's addObject:itemEmuFileURL)
  end if
end repeat

###解放
set ocidEmuFileURLArray to ""
set ocidEmuDict to ""

##############################################
##ゴミ箱に入れる
##############################################

repeat with itemFilePathURL in ocidFilePathURLArray
  
  log itemFilePathURL's |path|() as text
  ####ゴミ箱
  set listResult to (appFileManager's trashItemAtURL:itemFilePathURL resultingItemURL:(missing value) |error|:(reference))
  
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
##自分環境が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 appFileManager to refMe's NSFileManager's defaultManager()

###対象のアプリケーションのUTI
set strUTI to "com.skype.skype" as text


###################################
#まずは処理するアプリケーションを終了させる
###################################
doQuitApp2UTI("com.skype.skype")

###################################
#UTIからアプリケーションのインストール先を求める
###################################

set ocidAppBundle to refMe's NSBundle's bundleWithIdentifier:strUTI
if ocidAppBundle is missing value then
  set appNSWorkspace to refMe's NSWorkspace's sharedWorkspace()
  set ocidAppBundlePathURL to (appNSWorkspace's URLForApplicationWithBundleIdentifier:strUTI)
else
  set ocidAppBundleStr to ocidAppBundle's bundlePath()
  set ocidAppBundlePath to ocidAppBundleStr's stringByStandardizingPath
  set ocidAppBundlePathURL to (refMe's NSURL's fileURLWithPath:ocidAppBundlePath)
end if
###################################
#アプリケーションをゴミ箱に
###################################
if ocidAppBundlePathURL is missing value then
  log "アプリケーションが見つかりません"
else
  set listResult to (appFileManager's trashItemAtURL:ocidAppBundlePathURL resultingItemURL:(missing value) |error|:(reference))
end if


###################################
########キャッシュを削除する
###################################
set ocidUserLibraryPath to (appFileManager's URLsForDirectory:(refMe's NSLibraryDirectory) inDomains:(refMe's NSUserDomainMask))
###LibraryフォルダURL
set ocidLibraryPathURL to ocidUserLibraryPath's firstObject()

################################
####Caches
set ocidChkDirURL to ocidLibraryPathURL's URLByAppendingPathComponent:"Caches/com.skype.skype.ShipIt"
###中身をゴミ箱に入れる
doGo2TrashDirContentsURL(ocidChkDirURL)

###com.apple.dt.Xcode
set ocidChkDirURL to ocidLibraryPathURL's URLByAppendingPathComponent:"Caches/com.skype.skype"
###中身をゴミ箱に入れる
doGo2TrashDirContentsURL(ocidChkDirURL)

################################
####LOG
set ocidChkDirURL to ocidLibraryPathURL's URLByAppendingPathComponent:"Logs/Skype Helper (Renderer)"
###中身をゴミ箱に入れる
doGo2TrashDirContentsURL(ocidChkDirURL)


#############################################
#########ユーザーApplicationSupport
#############################################
set ocidUserApplicationSupportPath to (appFileManager's URLsForDirectory:(refMe's NSApplicationSupportDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidUserApplicationSupportPathURL to ocidUserApplicationSupportPath's objectAtIndex:0

#################################
###Microsof
set ocidMicrosoftDirURL to ocidUserApplicationSupportPathURL's URLByAppendingPathComponent:"Microsoft"

set ocidChkDirURL to ocidMicrosoftDirURL's URLByAppendingPathComponent:"Skype for Desktop/Cache/"
doGo2TrashDirContentsURL(ocidChkDirURL)
set ocidChkDirURL to ocidMicrosoftDirURL's URLByAppendingPathComponent:"Skype for Desktop/GPUCache/"
doGo2TrashDirContentsURL(ocidChkDirURL)
set ocidChkDirURL to ocidMicrosoftDirURL's URLByAppendingPathComponent:"Skype for Desktop/Code Cache/"
doGo2TrashDirContentsURL(ocidChkDirURL)

###きっちりやる時はこちらも
set ocidChkDirURL to ocidMicrosoftDirURL's URLByAppendingPathComponent:"Skype for Desktop/Partitions/"
doGo2TrashDirContentsURL(ocidChkDirURL)

#################################
###テンポラリ
set ocidTempDirPathURL to appFileManager's temporaryDirectory()
set ocidChkDirURL to ocidTempDirPathURL's URLByAppendingPathComponent:"Skype/"
doGo2TrashDirContentsURL(ocidChkDirURL)
set ocidChkDirURL to ocidTempDirPathURL's URLByAppendingPathComponent:"Skype Helper/"
doGo2TrashDirContentsURL(ocidChkDirURL)
set ocidChkDirURL to ocidTempDirPathURL's URLByAppendingPathComponent:"Skype Helper (GPU)/"
doGo2TrashDirContentsURL(ocidChkDirURL)
set ocidChkDirURL to ocidTempDirPathURL's URLByAppendingPathComponent:"Skype Helper (Renderer)/"
doGo2TrashDirContentsURL(ocidChkDirURL)

#################################
###テンポラリキャッシュ
set ocidContainerDirURL to ocidTempDirPathURL's URLByDeletingLastPathComponent()
set ocidChkDirURL to ocidContainerDirURL's URLByAppendingPathComponent:"C/com.skype.skype/"
doGo2TrashDirContentsURL(ocidChkDirURL)
set ocidChkDirURL to ocidContainerDirURL's URLByAppendingPathComponent:"C/com.skype.skype.Helper/"
doGo2TrashDirContentsURL(ocidChkDirURL)
set ocidChkDirURL to ocidContainerDirURL's URLByAppendingPathComponent:"C/com.skype.skype.Helper-(GPU)/"
doGo2TrashDirContentsURL(ocidChkDirURL)
set ocidChkDirURL to ocidContainerDirURL's URLByAppendingPathComponent:"C/com.skype.skype.Helper-(Renderer)/"
doGo2TrashDirContentsURL(ocidChkDirURL)




############################################
##ユーザードメインにアプリケーションフォルダを作る
set ocidUserAllApplicationsPath to (appFileManager's URLsForDirectory:(refMe's NSAllApplicationsDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidUserAllApplicationsDir to ocidUserAllApplicationsPath's firstObject()
set ocidAttrDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
set numPermissionDem to doOct2Dem(700) as integer
ocidAttrDict's setValue:numPermissionDem forKey:(refMe's NSFilePosixPermissions)
############################
###フォルダを作る
set listBoolMakeDir to appFileManager's createDirectoryAtURL:(ocidUserAllApplicationsDir) withIntermediateDirectories:true attributes:(ocidAttrDict) |error|:(reference)
############################
###localizedを作成
set ocidLocalizedDirPathURL to ocidUserAllApplicationsDir's URLByAppendingPathComponent:".localized" isDirectory:false
set ocidLocalizedDirPath to ocidLocalizedDirPathURL's |path|()
####空のファイルを作成する
set ocidBlankData to refMe's NSData's alloc()'s init()
set ocidAttrFile to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
ocidAttrFile's setValue:493 forKey:(refMe's NSFilePosixPermissions)
set boolMakeNewFile to appFileManager's createFileAtPath:ocidLocalizedDirPath |contents|:ocidBlankData attributes:ocidAttrFile

###################################
##本処理
###################################
set strDateno to doGetDateNo("yyyyMMDDhhmmss")


set strCommandText to ("/bin/mkdir -p /tmp/" & strDateno & "") as text
do shell script strCommandText

set strCommandText to ("/usr/bin/curl -L -o \"/tmp/" & strDateno & "/Skype.dmg\" \"https://go.skype.com/mac.download\" --connect-timeout 10; ") as text
do shell script strCommandText

set strCommandText to ("/usr/bin/hdiutil attach  /tmp/" & strDateno & "/Skype.dmg -noverify -nobrowse -noautoopen") as text
do shell script strCommandText

set strCommandText to ("/usr/bin/ditto \"/Volumes/Skype/Skype.app\" $HOME/Applications/Skype.app") as text
do shell script strCommandText


set strCommandText to ("/usr/bin/hdiutil detach /Volumes/Skype -force") as text
do shell script strCommandText

###################################
##Dockにアプリを登録する
###################################
set strAppFilePath to (do shell script "/bin/echo $HOME/Applications/Skype.app") as text

tell application "Finder"
  set aliasPathToMe to path to me as alias
  set aliasContainerDir to container of aliasPathToMe as alias
end tell

set strContainerDirPath to POSIX path of aliasContainerDir as text
set strBinPath to (strContainerDirPath & "bin/dockutil") as text

set strCommandText to ("\"" & strBinPath & "\" --add \"" & strAppFilePath & "\"") as text
do shell script strCommandText


###################################
########ディレクトリの中身をゴミ箱へ
###################################
on doGo2TrashDirContentsURL(ocidDirUrl)
  ###ファイルマネージャー初期化
  set appFileManager to refMe's NSFileManager's defaultManager()
  ################################
  ####渡された値がNSURL以外の場合の処理
  try
    set strClassName to class of ocidDirUrl as text
    ####渡された値がテキストだったら
    if strClassName is "text" then
      set strDirUrl to ocidDirUrl as text
      ####渡された値がエイリアスだったら
    else if strClassName is "alias" then
      set strDirPath to POSIX path of ocidDirUrl as text
    end if
    set ocidFilePath to (refMe's NSString's stringWithString:strDirPath)
    set ocidFilePathString to ocidFilePath's stringByStandardizingPath
    set ocidDirPathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:ocidFilePathString isDirectory:true)
  on error
    ######ocid形式の値だったら
    set strClassName to ocidDirUrl's className() as text
    ###テキストなら
    if strClassName contains "NSCFString" then
      set ocidFilePathString to ocidDirUrl's stringByStandardizingPath
      set ocidDirPathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:ocidFilePathString isDirectory:true)
      ###NSURLなら
    else if strClassName is "NSURL" then
      set ocidDirPathURL to ocidDirUrl
    else
      error "NSURLを指定してください" number -9999
      return
    end if
  end try
  ################################
  ####渡されたパスが無い場合はエラー
  set ocidFilePathString to ocidDirPathURL's |path|()
  set boolFolderExists to (appFileManager's fileExistsAtPath:ocidFilePathString isDirectory:true)
  if boolFolderExists is false then
    log "パス先が実在しません"
    ####パス先ない場合は作っておく
    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:(ocidDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error|:(reference)
    return
  end if
  ################################
  ####ディレクトリか?の判断 ファイルならエラーで止める 
  set ocidResultArray to ocidDirPathURL's getResourceValue:(reference) forKey:(refMe's NSURLIsDirectoryKey) |error|:(reference)
  if (item 3 of ocidResultArray) is not (missing value) then
    doGetErrorData(ocidNSErrorData)
  end if
  set ocidResultValue to item 2 of ocidResultArray
  -->false
  set ocidFalse to (refMe's NSNumber's numberWithBool:false)'s boolValue
  if ocidResultValue is ocidFalse then
    ##error "パス先がファイルですディレクトリを指定してください" number -9999
    log "パス先がファイルですディレクトリを指定してください"
    return
  end if
  ##################################
  ##内包リスト
  set listResult to appFileManager's contentsOfDirectoryAtURL:ocidDirPathURL includingPropertiesForKeys:{refMe's NSURLPathKey} options:0 |error|:(reference)
  ###エラー発生時
  if (item 2 of listResult) is not (missing value) then
    doGetErrorData(item 2 of listResult)
  end if
  
  ###結果
  set ocidPathArray to item 1 of listResult
  repeat with itemPathArray in ocidPathArray
    set ocidPathArrayURL to itemPathArray
    ##ゴミ箱に入れる
    set listResult to (appFileManager's trashItemAtURL:ocidPathArrayURL resultingItemURL:(missing value) |error|:(reference))
    ###エラー発生時
    if (item 2 of listResult) is not (missing value) then
      doGetErrorData(item 2 of listResult)
    end if
  end repeat
end doGo2TrashDirContentsURL


###################################
########ディレクトリの中身をゴミ箱へ サブパス指定式
###################################

to doChkDirSubPath2Trash(argChkURL, argSubPathText)
  ###ファイルマネージャー初期化
  set appFileManager to refMe's NSFileManager's defaultManager()
  ##内包リスト
  set listResult to appFileManager's contentsOfDirectoryAtURL:argChkURL includingPropertiesForKeys:{refMe's NSURLPathKey} options:0 |error|:(reference)
  ###結果
  set ocidPathArray to item 1 of listResult
  ####リストの数だけ
  repeat with itemPathArrayURL in ocidPathArray
    set ocidChkURL to (itemPathArrayURL's URLByAppendingPathComponent:argSubPathText)
    ####渡されたパスが無い場合はエラー
    set ocidFilePathString to ocidChkURL's |path|()
    set boolFolderExists to (appFileManager's fileExistsAtPath:ocidFilePathString isDirectory:true)
    if boolFolderExists is false then
      log "パス先が実在しません:\n" & (ocidFilePathString as text)
    else
      log "処理する"
      set listSubPathResult to (appFileManager's contentsOfDirectoryAtURL:ocidChkURL includingPropertiesForKeys:{refMe's NSURLPathKey} options:0 |error|:(reference))
      set ocidSubPathArray to item 1 of listSubPathResult
      repeat with itemSubPathArray in ocidSubPathArray
        set ocidItemPathArrayURL to itemSubPathArray
        ##ゴミ箱に入れる
        set listResult to (appFileManager's trashItemAtURL:ocidItemPathArrayURL resultingItemURL:(missing value) |error|:(reference))
      end repeat
      
    end if
    
  end repeat
  
end doChkDirSubPath2Trash



###################################
########アプリケーションを終了させる
###################################
to doQuitApp2UTI(argUTI)
  set strUTI to argUTI as text
  set ocidResultsArray to refMe's NSRunningApplication's runningApplicationsWithBundleIdentifier:strUTI
  set numCntArray to ocidResultsArray count
  if numCntArray ≠ 0 then
    set ocidRunApp to ocidResultsArray's objectAtIndex:0
    
    ###通常終了
    set boolDone to ocidRunApp's terminate()
    ####強制終了
    set boolDone to ocidRunApp's forceTerminate()
    
    #### killallを使う場合
    set ocidExecAppURL to ocidRunApp's executableURL()
    set ocidFileName to ocidExecAppURL's lastPathComponent()
    set strFileName to ocidFileName as text
    
    set strCommandText to ("/usr/bin/killall -z " & strFileName & "") as text
    set ocidCommandText to refMe's NSString's stringWithString:strCommandText
    set ocidTermTask to refMe's NSTask's alloc()'s init()
    ocidTermTask's setLaunchPath:"/bin/zsh"
    ocidTermTask's setArguments:({"-c", ocidCommandText})
    set listDoneReturn to ocidTermTask's launchAndReturnError:(reference)
    
    
    ####killを使う場合
    set ocidPID to ocidRunApp's processIdentifier()
    set strPID to ocidPID as text
    log strPID
    set strCommandText to ("/bin/kill -9 " & strPID & "") as text
    set ocidCommandText to refMe's NSString's stringWithString:strCommandText
    set ocidTermTask to refMe's NSTask's alloc()'s init()
    ocidTermTask's setLaunchPath:"/bin/zsh"
    ocidTermTask's setArguments:({"-c", ocidCommandText})
    set listDoneReturn to ocidTermTask's launchAndReturnError:(reference)
    
    
  end if
end doQuitApp2UTI


###################################
########エラー処理
###################################

to doGetErrorData(ocidNSErrorData)
  #####個別のエラー情報
  log "エラーコード:" & ocidNSErrorData's code() as text
  log "エラードメイン:" & ocidNSErrorData's domain() as text
  log "Description:" & ocidNSErrorData's localizedDescription() as text
  log "FailureReason:" & ocidNSErrorData's localizedFailureReason() as text
  log ocidNSErrorData's localizedRecoverySuggestion() as text
  log ocidNSErrorData's localizedRecoveryOptions() as text
  log ocidNSErrorData's recoveryAttempter() as text
  log ocidNSErrorData's helpAnchor() as text
  set ocidNSErrorUserInfo to ocidNSErrorData's userInfo()
  set ocidAllValues to ocidNSErrorUserInfo's allValues() as list
  set ocidAllKeys to ocidNSErrorUserInfo's allKeys() as list
  repeat with ocidKeys in ocidAllKeys
    if (ocidKeys as text) is "NSUnderlyingError" then
      log (ocidNSErrorUserInfo's valueForKey:ocidKeys)'s localizedDescription() as text
      log (ocidNSErrorUserInfo's valueForKey:ocidKeys)'s localizedFailureReason() as text
      log (ocidNSErrorUserInfo's valueForKey:ocidKeys)'s localizedRecoverySuggestion() as text
      log (ocidNSErrorUserInfo's valueForKey:ocidKeys)'s localizedRecoveryOptions() as text
      log (ocidNSErrorUserInfo's valueForKey:ocidKeys)'s recoveryAttempter() as text
      log (ocidNSErrorUserInfo's valueForKey:ocidKeys)'s helpAnchor() as text
    else
      ####それ以外の値はそのままテキストで読める
      log (ocidKeys as text) & ": " & (ocidNSErrorUserInfo's valueForKey:ocidKeys) as text
    end if
  end repeat
  
end doGetErrorData
###################################
#####パーミッション 8進→10進
(*
###主要なモード NSFilePosixPermissions
777-->511
775-->509
770-->504
755-->493
750-->488
700-->448
555-->365
333-->219
*)
###################################

to doOct2Dem(argOctNo)
  set strOctalText to argOctNo as text
  set num3Line to first item of strOctalText as number
  set num2Line to 2nd item of strOctalText as number
  set num1Line to last item of strOctalText as number
  set numDecimal to (num3Line * 64) + (num2Line * 8) + (num1Line * 1)
  return numDecimal as integer
end doOct2Dem




to doGetDateNo(strDateFormat)
  ####日付情報の取得
  set ocidDate to current application's NSDate's |date|()
  ###日付のフォーマットを定義
  set ocidNSDateFormatter to current application's NSDateFormatter's alloc()'s init()
  ocidNSDateFormatter's setLocale:(current application's NSLocale's localeWithLocaleIdentifier:"ja_JP_POSIX")
  ocidNSDateFormatter's setDateFormat:strDateFormat
  set ocidDateAndTime to ocidNSDateFormatter's stringFromDate:ocidDate
  set strDateAndTime to ocidDateAndTime as text
  return strDateAndTime
end doGetDateNo

|

[Logs]ユーザーログファイルを全部ゴミ箱へ

修正版 https://quicktimer.cocolog-nifty.com/icefloe/2023/05/post-9a5f20.html

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

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

(*
Chromeエンジン使っているアプリは終了させてから実行しないと
chrome_crashpadがログを書き込めなくなるので
恐ろしい数のエラーが出ます。
*)
###Chromeエンジン使っているアプリは終了させてから
tell application id "com.google.Chrome" to quit
tell application id "com.microsoft.VSCode" to quit
###終了を待つ
delay 5
####################################
####対象ディレクトリ
####################################
####ライブラリーのURL
set ocidLibraryURLArray to (appFileManager's URLsForDirectory:(refMe's NSLibraryDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidUserLibraryURL to ocidLibraryURLArray's objectAtIndex:0
set ocidLogDirPathURL to (ocidUserLibraryURL's URLByAppendingPathComponent:"Logs" isDirectory:true)

##############################################
##準備
##############################################
###enumeratorAtURL用のBoolean
set ocidFalse to (refMe's NSNumber's numberWithBool:false)
set ocidTrue to (refMe's NSNumber's numberWithBool:true)
###enumeratorAtURLL格納用のレコード
set ocidEmuDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
###enumeratorAtURLL格納するリスト
set ocidEmuFileURLArray to refMe's NSMutableArray's alloc()'s initWithCapacity:0
###ファイルURLのみを格納するリスト
set ocidFilePathURLArray to refMe's NSMutableArray's alloc()'s initWithCapacity:0

##############################################
##ディレクトリのコンテツを収集
##############################################
###収集する付随プロパティ
set ocidPropertiesForKeys to {refMe's NSURLIsRegularFileKey}
####ディレクトリのコンテツを収集
set ocidEmuDict to (appFileManager's enumeratorAtURL:ocidLogDirPathURL includingPropertiesForKeys:ocidPropertiesForKeys options:(refMe's NSDirectoryEnumerationSkipsHiddenFiles) errorHandler:(reference))
###戻り値用のリストに格納
set ocidEmuFileURLArray to ocidEmuDict's allObjects()

##############################################
##『ファイル』だけ取り出したリストにする
##############################################

####enumeratorAtURLのかずだけ繰り返し
repeat with itemEmuFileURL in ocidEmuFileURLArray
  ####URLforKeyで取り出し
  set listResult to (itemEmuFileURL's getResourceValue:(reference) forKey:(refMe's NSURLIsRegularFileKey) |error|:(reference))
  ###リストからNSURLIsRegularFileKeyBOOLを取り出し
  set boolIsRegularFileKey to item 2 of listResult
  ####ファイルのみを(ディレクトリやリンボリックリンクは含まない)
  if boolIsRegularFileKey is ocidTrue then
    ####リストにする
    (ocidFilePathURLArray's addObject:itemEmuFileURL)
  end if
end repeat

###解放
set ocidEmuFileURLArray to ""
set ocidEmuDict to ""

##############################################
##ゴミ箱に入れる
##############################################

repeat with itemFilePathURL in ocidFilePathURLArray
  
  log itemFilePathURL's |path|() as text
  ####ゴミ箱
  set listResult to (appFileManager's trashItemAtURL:itemFilePathURL resultingItemURL:(missing value) |error|:(reference))
  
end repeat

| | コメント (0)

[mdimport]Spotlightリセット(要管理者権限)

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

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

property refMe : a reference to current application


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


do shell script "/usr/bin/sudo mdutil -i off -E" with administrator privileges
do shell script "/usr/bin/sudo mdutil -E /" with administrator privileges
do shell script "/usr/bin/sudo mdutil -i on /" with administrator privileges


##########################################
####### mdimporterへのパスリストを作成
##########################################
####ライブラリーのURL
set ocidLibraryURLArray to (appFileManager's URLsForDirectory:(refMe's NSLibraryDirectory) inDomains:(refMe's NSAllDomainsMask))
####戻り値格納用の可変リスト
set ocidURLArray to refMe's NSMutableArray's alloc()'s initWithCapacity:0
####ライブラリの数だけ繰り返し
repeat with itemLibraryURLArray in ocidLibraryURLArray
  ####Spotlightのディレクトリ
  set ocidSpotlightDirURL to (itemLibraryURLArray's URLByAppendingPathComponent:"Spotlight" isDirectory:true)
  ####mdimporterへのパスを取得
  set listContentsArray to (appFileManager's contentsOfDirectoryAtURL:ocidSpotlightDirURL includingPropertiesForKeys:{refMe's NSURLPathKey} options:(refMe's NSDirectoryEnumerationSkipsHiddenFiles) |error|:(reference))
  set ocidContentsArray to item 1 of listContentsArray
  if ocidContentsArray is not (missing value) then
    ####格納する
    (ocidURLArray's addObjectsFromArray:ocidContentsArray)
  end if
end repeat
##########################################
####### コマンド実行
##########################################
repeat with itemURLArray in ocidURLArray
  ##UNIXパスにして
  set ocidFilePath to itemURLArray's |path|()
  set strFilePath to ocidFilePath as text
  ###コマンド実行
  set strCommandText to "/usr/bin/mdimport -r \"" & strFilePath & "\"" as text
  do shell script strCommandText
end repeat

##########################################
####### オプション
##########################################
###アウトルック
set ocidAppBundle to refMe's NSBundle's bundleWithIdentifier:"com.microsoft.Outlook"
if ocidAppBundle is not (missing value) then
  set ocidAppBundlePath to ocidAppBundle's bundlePath()
  set ocidFilePath to ocidAppBundlePath's stringByStandardizingPath
  set ocidFilePathArray to ocidFilePath's stringsByAppendingPaths:{"Contents/Library/Spotlight/Microsoft Outlook Spotlight Importer.mdimporter"}
  set strFilePath to (ocidFilePathArray's objectAtIndex:0) as text
  ###コマンド実行
  set strCommandText to "/usr/bin/mdimport -r \"" & strFilePath & "\"" as text
  do shell script strCommandText
else
  set appNSWorkspace to refMe's NSWorkspace's sharedWorkspace()
  set ocidAppBundlePathURL to appNSWorkspace's URLForApplicationWithBundleIdentifier:"com.microsoft.Outlook"
  set ocidSpotlightDirURL to (ocidAppBundlePathURL's URLByAppendingPathComponent:"Contents/Library/Spotlight/Microsoft Outlook Spotlight Importer.mdimporter" isDirectory:true)
  set strFilePath to ocidSpotlightDirURL's |path|() as text
  ###コマンド実行
  set strCommandText to "/usr/bin/mdimport -r \"" & strFilePath & "\"" as text
  do shell script strCommandText
end if

###スクリプトデバッガー
set ocidAppBundle to refMe's NSBundle's bundleWithIdentifier:"com.latenightsw.ScriptDebugger8"
if ocidAppBundle is not (missing value) then
  set ocidAppBundlePath to ocidAppBundle's bundlePath()
  set ocidFilePath to ocidAppBundlePath's stringByStandardizingPath
  set ocidFilePathArray to ocidFilePath's stringsByAppendingPaths:{"Contents/Library/Spotlight/SDImporter.mdimporter"}
  set strFilePath to (ocidFilePathArray's objectAtIndex:0) as text
  ###コマンド実行
  set strCommandText to "/usr/bin/mdimport -r \"" & strFilePath & "\"" as text
  do shell script strCommandText
else
  set appNSWorkspace to refMe's NSWorkspace's sharedWorkspace()
  set ocidAppBundlePathURL to appNSWorkspace's URLForApplicationWithBundleIdentifier:"com.latenightsw.ScriptDebugger8"
  set ocidSpotlightDirURL to (ocidAppBundlePathURL's URLByAppendingPathComponent:"Contents/Library/Spotlight/SDImporter.mdimporter" isDirectory:true)
  set strFilePath to ocidSpotlightDirURL's |path|() as text
  ###コマンド実行
  set strCommandText to "/usr/bin/mdimport -r \"" & strFilePath & "\"" as text
  do shell script strCommandText
end if

##########################################
####### メールデータのインデックス
##########################################
do shell script "/usr/bin/mdimport -i $HOME/Library/Group\\ Containers/UBF8T346G9.Office/Outlook"

do shell script "/usr/bin/mdimport -i $HOME/Library/Mail"

###インポートポイントはあとはお好みで





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