AppleScript NSKeyedArchiver

com.apple.sharedfilelist

com.apple.sharedfilelist
macOS14で拡張子がsfl2からsfl3に変わった
キーアーカイブされたPLISTデータの取り扱いについて

リセットは今まで通り『sfltool』が利用できます
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-3140f3.html
ここでは、キー・アーカイブのことを
NSKeyedArchiverを圧縮
NSKeyedUnarchiverを解凍と呼んでいます

macOS13まので
圧縮 archivedDataWithRootObject
解凍 unarchiveObjectWithData 

非推奨から利用できなくなりましたので
macOS14では
圧縮 archivedDataWithRootObject:() requiringSecureCoding:() |error|:()
解凍 unarchivedObjectOfClass:(class)fromData:() |error|:() 

使う事になります
com.apple.sharedfilelistのsfl3ファイルはrequiringSecureCodingはfalse=NOが使われます。
macOS13までのスクリプトもこの部分を修正すればそのまま利用できます
Comapplesharedfilelist001

macOS14
圧縮:NSKeyedArchiver
202403201133261332x646

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

set listSaveData to (refMe's NSKeyedArchiver's archivedDataWithRootObject:(ocidReplaceDict) requiringSecureCoding:(true) |error|:(reference))
set ocidSaveData to (item 1 of listSaveData)
set ocidOption to (refMe's NSDataWritingFileProtectionNone)
set listDone to (ocidSaveData's writeToURL:(ocidSfl3FilePathURL) options:(ocidOption) |error|:(reference))
set boolDone to (item 1 of listDone) as boolean
if boolDone is false then
log (item 2 of listDone)'s localizedDescription() as text
return "保存に失敗しました"
end if

解凍:NSKeyedUnarchiver
202403201131291322x638

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

set ocidPlistData to (refMe's NSData's dataWithContentsOfURL:(ファイルのURL))
set listResponse to refMe's NSKeyedUnarchiver's unarchivedObjectOfClass:((refMe's NSObject)'s class) fromData:(ocidPlistData) |error|:(reference)
set ocidPlistDict to (item 1 of listResponse)

LSSharedFileList カテゴリ
https://quicktimer.cocolog-nifty.com/icefloe/cat76055054/index.html

【1】圧縮:NSKeyedArchiver
[NSKeyedArchiver]plistをsfl3形式にKeyedArchiveする
https://quicktimer.cocolog-nifty.com/icefloe/2023/12/post-8e56a6.html


【2】解凍:NSKeyedUnarchiver
[NSKeyedUnarchiver]sfl3をplist形式にKeyedUnarchiveする
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-e2ea07.html

[LSSharedFileList] unarchivedObjectOfClassesで解凍する
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-2d749d.html

com.apple.LSSharedFileList.RecentServers.sfl3
[LSSharedFileList] unarchivedObjectOfClassesで解凍する
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-2d749d.html
[LSSharedFileList]最近使った項目のサーバー部分をリセットする(macOS14 sfl3対応)
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-00119a.html

com.apple.LSSharedFileList.RecentHosts.sfl3
[LSSharedFileList]サーバーに接続の履歴部分をリセットする(macOS14 sfl3対応)
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-5833e6.html

com.apple.LSSharedFileList.RecentDocuments.sfl3
[LSSharedFileList]最近使った項目の書類部分をリセットする(macOS14 sfl3対応)
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-d344c8.html

com.apple.LSSharedFileList.RecentApplications.sfl3
[LSSharedFileList]最近使った項目のアプリケーション部分をリセットする(macOS14 sfl3対応)
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-acaee1.html

com.apple.LSSharedFileList.ProjectsItems.sfl3
プロジェクトアイテムはラベルとタグのカテゴリをみてください
https://quicktimer.cocolog-nifty.com/icefloe/cat76054827/index.html

com.apple.LSSharedFileList.NetworkBrowser.sfl3
[sfl3 LSSharedFileList] com.apple.LSSharedFileList.NetworkBrowser.sfl3の設定変更 (macOS14対応版)
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-601a41.html

com.apple.LSSharedFileList.iCloudItems.sfl3
[sfl3 LSSharedFileList]サイドバーiCloud編集(iCloudItems.sfl3)検索条件を加える macOS14対応版
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-3a956e.html

com.apple.LSSharedFileList.FavoriteVolumes.sfl3
[sfl3 FavoriteVolumes.sfl3]接続中のiPhoneを開く(sfl3 macOS14対応)
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-30f29a.html
[sfl3 LSSharedFileList] com.apple.LSSharedFileList.FavoriteVolumes.sfl3の設定変更 (macOS14対応版)
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-d202b0.html

com.apple.LSSharedFileList.FavoriteServers.sfl3
[LSSharedFileList]サーバーへ接続のよく使うサーバーを追加
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-41922b.html

com.apple.LSSharedFileList.FavoriteItems.sfl3
[sfl3 LSSharedFileList]Finderサイドバーのよく使う項目を追加する
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-7f4cb0.html
[FavoriteItems.sfl3]Finderサイドバーにフォルダを追加(macOS14対応版)
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-e38f0e.html
[LSSharedFileList]サイドバーよく使う項目にiCloudを追加する(FavoriteItems.sfl3 macOS14対応版)
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-3b822c.html

com.apple.LSSharedFileList.ApplicationRecentDocuments.sfl3
[ApplicationRecentDocuments]アプリケーションの最近使った項目をリセットする
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-0516ef.html

com.apple.LSSharedFileList.ApplicationRecentDocuments
[com.apple.sharedfilelist]最近使った書類を初期化する(com.apple.LSSharedFileList.ApplicationRecentDocuments)
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-1556a6.html

|

ラベル(色)指定のあるタグを作成する


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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
# macOS14版
# 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 strTagName to ("名称未設定新規タグ") as text
##ラベル番号=色ね
(*
0:ラベル無し
1:グレー
2:グリーン
3:パープル
4:ブルー
5:イエロー
6:レッド
7:オレンジ
*)
set numLabelNo to 6 as integer


###実行
log doMakeTagName(strTagName, numLabelNo)



#######################################
##ファンクション
#######################################
to doMakeTagName(argTagNameText, argLabeClolorNo)
  
  set strName to argTagNameText as text
  set numLabelNo to argLabeClolorNo as integer
  set appFileManager to refMe's NSFileManager's defaultManager()
  ###処理するファイル名
  set strFileName to "com.apple.LSSharedFileList.ProjectsItems.sfl3" as text
  ###URLに
  set ocidURLArray to (appFileManager's URLsForDirectory:(refMe's NSApplicationSupportDirectory) inDomains:(refMe's NSUserDomainMask))
  set ocidAppSuppDirPathURL to ocidURLArray's firstObject()
  set ocidContainerPathURL to (ocidAppSuppDirPathURL's URLByAppendingPathComponent:("com.apple.sharedfilelist") isDirectory:true)
  set ocidSharedFileListURL to (ocidContainerPathURL's URLByAppendingPathComponent:(strFileName) isDirectory:false)
  ###NSDATAに読み込みます
  set ocidPlistData to (refMe's NSData's dataWithContentsOfURL:(ocidSharedFileListURL))
  ### 解凍してDictに Flozenなので値を変更するために 可変に変えます
  #NSKeyedUnarchiver's  OS13までの方式
  # set ocidArchveDict to (refMe's NSKeyedUnarchiver's unarchiveObjectWithData:(ocidPlistData))
  #NSKeyedUnarchiver's  OS14からの方式
  set listResponse to refMe's NSKeyedUnarchiver's unarchivedObjectOfClass:((refMe's NSObject)'s class) fromData:(ocidPlistData) |error|:(reference)
  set ocidArchveDict to (item 1 of listResponse)
  ### 可変Dictにセット
  set ocidArchveDictM to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
(ocidArchveDictM's setDictionary:ocidArchveDict)
  #######################################
  ### items の処理
  #######################################
  ### items のArrayを取り出して Flozenなので値を変更するために 可変に変えます
  set ocidItemsArray to (ocidArchveDictM's objectForKey:("items"))
  ### 項目入替用のArray 
  set ocidItemsArrayM to (refMe's NSMutableArray's alloc()'s initWithCapacity:0)
(ocidItemsArrayM's setArray:ocidItemsArray)
  ##################
  ###itemsの数だけ繰り返し
  repeat with itemsArrayDict in ocidItemsArray
    #
    set strItemName to (itemsArrayDict's objectForKey:("Name")) as text
    if strItemName is strName then
      ###値があった場合
      set boolChkTagName to true as boolean
      exit repeat
    else
      ###なかった場合
      set boolChkTagName to false as boolean
    end if
  end repeat
log "タグの有無:" & boolChkTagName
  #######################################
  ### タグがない場合は作る
  #######################################
  if boolChkTagName is false then
    try
      set strAgentPath to "/System/Library/LaunchAgents/com.apple.coreservices.sharedfilelistd.plist"
      set strCommandText to ("/bin/launchctl unload -w \"" & strAgentPath & "\"") as text
do shell script strCommandText
    end try
    try
      set strAgentPath to "/System/Library/LaunchAgents/com.apple.cfprefsd.xpc.agent.plist"
      set strCommandText to ("/bin/launchctl unload -w \"" & strAgentPath & "\"") as text
do shell script strCommandText
    end try
    ### 項目追加用のDict
    set ocidAddProkectDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
    set ocidCustomPropertiesDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
    ################################CustomItemProperties
    set ocidTrue to refMe's NSNumber's numberWithBool:(true)
ocidCustomPropertiesDict's setValue:(ocidTrue) forKey:("kLSSharedTagFileListItemPinned")
    ##表示させたい場合はここをocidFalseに
    set ocidTrue to refMe's NSNumber's numberWithBool:(true)
ocidCustomPropertiesDict's setValue:(ocidTrue) forKey:("com.apple.LSSharedFileList.ItemIsHidden")
    ##
    set ocidLabelNo to refMe's NSNumber's numberWithInteger:(numLabelNo)
ocidCustomPropertiesDict's setValue:(ocidLabelNo) forKey:("kLSSharedTagFileListItemLabel")
    ##CustomItemPropertiesでDictを追加
ocidAddProkectDict's setObject:(ocidCustomPropertiesDict) forKey:("CustomItemProperties")
    #######################################
    ### Bookmarkデータ生成
    #######################################
    (*
URL形式で
x-apple-findertag:%エンコードされたタグの名前
の形式になります
*)
    set ocidURLComponents to refMe's NSURLComponents's alloc()'s init()
ocidURLComponents's setScheme:("x-apple-findertag")
ocidURLComponents's setPath:(strName)
    set ocidTagURL to ocidURLComponents's |URL|()
    set listBookMarkData to (ocidTagURL's bookmarkDataWithOptions:(11) includingResourceValuesForKeys:({missing value}) relativeToURL:(missing value) |error|:(reference))
    set ocidBookMarkData to item 1 of listBookMarkData
ocidAddProkectDict's setObject:(ocidBookMarkData) forKey:("Bookmark")
    ##
    set ocidTagName to refMe's NSString's stringWithString:(strName)
ocidAddProkectDict's setObject:(ocidTagName) forKey:("Name")
    ##
    set ocidUUID to refMe's NSUUID's alloc()'s init()
    set ocidUUIDString to ocidUUID's UUIDString()
ocidAddProkectDict's setValue:(ocidUUIDString) forKey:("uuid")
    ##
    set ocidVisibility to refMe's NSNumber's numberWithInteger:(0)
ocidAddProkectDict's setValue:(ocidVisibility) forKey:("visibility")
    ##itemsのArrayに追加
ocidItemsArrayM's addObject:(ocidAddProkectDict)
    ### RootにItemsを追加
(ocidArchveDictM's setObject:(ocidItemsArrayM) forKey:("items"))
    #######################################
    ### 値が新しくなった解凍済みDictをアーカイブする
    #######################################
    ##NSKeyedArchiverに戻す OS13までの形式
    # set listSaveData to (refMe's NSKeyedArchiver's archivedDataWithRootObject:(ocidArchveDictM) requiringSecureCoding:(true) |error|:(reference))
    ##NSKeyedArchiver OS14からの形式
    set listSaveData to refMe's NSKeyedArchiver's archivedDataWithRootObject:(ocidArchveDictM) requiringSecureCoding:(false) |error|:(reference)
    set ocidSaveData to item 1 of listSaveData
    ###########
    ##保存
    set listDone to ocidSaveData's writeToURL:(ocidSharedFileListURL) options:0 |error|:(reference)
    ###########
    ###リロード
    ###########
    try
      set strAgentPath to "/System/Library/LaunchAgents/com.apple.coreservices.sharedfilelistd.plist"
      set strCommandText to ("/bin/launchctl load -w \"" & strAgentPath & "\"") as text
do shell script strCommandText
    end try
    try
      set strAgentPath to "/System/Library/LaunchAgents/com.apple.cfprefsd.xpc.agent.plist"
      set strCommandText to ("/bin/launchctl load -w \"" & strAgentPath & "\"") as text
do shell script strCommandText
    end try
delay 1
    try
do shell script "/usr/bin/killall cfprefsd"
    end try
    try
do shell script "/usr/bin/killall sharedfilelistd"
    end try
    
    
  else
    try
do shell script "/usr/bin/killall cfprefsd"
    end try
    
    try
do shell script "/usr/bin/killall sharedfilelistd"
    end try
  end if
  
  
  
  
end doMakeTagName


|

[LSSharedFileList.ProjectsItems]色指定付きのタグを作る(macOS14 sfl3対応)

Screen_20230809_11_58_19_20240312193201

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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
(*
Finder>>設定>>タグに項目を追加します
macOS14以降のsfl3版です
*)
----+----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 strName to ("Windows非互換文字") as text
###ラベルカラー番号
set numLabelNo to (5) as integer
(* ラベルカラー番号 Finderラベル番号の逆順なので留意ください
0 なし
1 グレイ
2 グリーン
3 パープル
4 ブルー
5 イエロー
6 レッド
7 オレンジ
*)

#######################################
##NSdataに読み込み Keyを解凍する
#######################################
set appFileManager to refMe's NSFileManager's defaultManager()
###処理するファイル名
set strFileName to "com.apple.LSSharedFileList.ProjectsItems.sfl3" as text
###URLに
set ocidURLArray to (appFileManager's URLsForDirectory:(refMe's NSApplicationSupportDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidAppSuppDirPathURL to ocidURLArray's firstObject()
set ocidContainerPathURL to (ocidAppSuppDirPathURL's URLByAppendingPathComponent:("com.apple.sharedfilelist") isDirectory:true)
set ocidSharedFileListURL to (ocidContainerPathURL's URLByAppendingPathComponent:(strFileName) isDirectory:false)
###NSDATAに読み込みます
set ocidPlistData to (refMe's NSData's dataWithContentsOfURL:(ocidSharedFileListURL))
### 解凍してDictに Flozenなので値を変更するために 可変に変えます
#NSKeyedUnarchiver's  OS13までの方式
# set ocidArchveDict to (refMe's NSKeyedUnarchiver's unarchiveObjectWithData:(ocidPlistData))
#NSKeyedUnarchiver's  OS14からの方式
set listResponse to refMe's NSKeyedUnarchiver's unarchivedObjectOfClass:((refMe's NSObject)'s class) fromData:(ocidPlistData) |error|:(reference)
set ocidArchveDict to (item 1 of listResponse)
### 可変Dictにセット
set ocidArchveDictM to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
(ocidArchveDictM's setDictionary:ocidArchveDict)

#######################################
### items の処理
#######################################
### items のArrayを取り出して Flozenなので値を変更するために 可変に変えます
set ocidItemsArray to (ocidArchveDictM's objectForKey:("items"))
### 項目入替用のArray 
set ocidItemsArrayM to (refMe's NSMutableArray's alloc()'s initWithCapacity:0)
(ocidItemsArrayM's setArray:ocidItemsArray)
set numCntArrayItem to count of ocidItemsArray
#######################################
### 値がすでにあるか?確認
set boolChkTagName to (missing value)
##################
###itemsの数だけ繰り返し
repeat with itemsArrayDict in ocidItemsArrayM
  ####
  set strItemName to (itemsArrayDict's objectForKey:("Name")) as text
  if strItemName is strName then
    ###値があった場合
    set boolChkTagName to true as boolean
    exit repeat
  else
    ###なかった場合
    set boolChkTagName to false as boolean
  end if
end repeat
#######################################
### 本処理項目の追加
#######################################
### 項目追加用のDict
set ocidAddProkectDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
set ocidCustomPropertiesDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
###すでにあるか?判定でなけば追加する
if boolChkTagName is false then
  ################################CustomItemProperties
  set ocidTrue to refMe's NSNumber's numberWithBool:(true)
ocidCustomPropertiesDict's setValue:(ocidTrue) forKey:("kLSSharedTagFileListItemPinned")
  ##表示させたい場合はここをocidFalseに
  set ocidTrue to refMe's NSNumber's numberWithBool:(true)
ocidCustomPropertiesDict's setValue:(ocidTrue) forKey:("com.apple.LSSharedFileList.ItemIsHidden")
  (* #### LabelNumber
0:ラベル無し
1:グレー
2:グリーン
3:パープル
4:ブルー
5:イエロー
6:レッド
7:オレンジ
*)
  set numLabelNo to 3 as integer
  #
  set ocidLabelNo to refMe's NSNumber's numberWithInteger:(numLabelNo)
ocidCustomPropertiesDict's setValue:(ocidLabelNo) forKey:("kLSSharedTagFileListItemLabel")
  ##CustomItemPropertiesでDictを追加
ocidAddProkectDict's setObject:(ocidCustomPropertiesDict) forKey:("CustomItemProperties")
  ################################ 追加用のDict root
  (* Bookmarkデータ生成
URL形式で
x-apple-findertag:%エンコードされたタグの名前
の形式になります
*)
  set ocidURLComponents to refMe's NSURLComponents's alloc()'s init()
ocidURLComponents's setScheme:("x-apple-findertag")
ocidURLComponents's setPath:(strName)
  set ocidTagURL to ocidURLComponents's |URL|()
  set listBookMarkData to (ocidTagURL's bookmarkDataWithOptions:(11) includingResourceValuesForKeys:({missing value}) relativeToURL:(missing value) |error|:(reference))
  set ocidBookMarkData to item 1 of listBookMarkData
ocidAddProkectDict's setObject:(ocidBookMarkData) forKey:("Bookmark")
  ##
  set ocidTagName to refMe's NSString's stringWithString:(strName)
ocidAddProkectDict's setObject:(ocidTagName) forKey:("Name")
  ##
  set ocidUUID to refMe's NSUUID's alloc()'s init()
  set ocidUUIDString to ocidUUID's UUIDString()
ocidAddProkectDict's setValue:(ocidUUIDString) forKey:("uuid")
  ##
  set ocidVisibility to refMe's NSNumber's numberWithInteger:(0)
ocidAddProkectDict's setValue:(ocidVisibility) forKey:("visibility")
  ##itemsのArrayに追加
ocidItemsArrayM's addObject:(ocidAddProkectDict)
end if
### RootにItemsを追加
(ocidArchveDictM's setObject:(ocidItemsArrayM) forKey:("items"))

#######################################
### 値が新しくなった解凍済みDictをアーカイブする
#######################################
##NSKeyedArchiverに戻す OS13までの形式
# set listSaveData to (refMe's NSKeyedArchiver's archivedDataWithRootObject:(ocidArchveDictM) requiringSecureCoding:(true) |error|:(reference))
##NSKeyedArchiver OS14からの形式
set listSaveData to refMe's NSKeyedArchiver's archivedDataWithRootObject:(ocidArchveDictM) requiringSecureCoding:(false) |error|:(reference)
set ocidSaveData to item 1 of listSaveData

#######################################
### データを上書き保存する
#######################################
##保存
set listDone to ocidSaveData's writeToURL:(ocidSharedFileListURL) options:0 |error|:(reference)

#######################################
### リロード
#######################################
try
do shell script "/usr/bin/killall sharedfilelistd"
on error
  set strAgentPath to "/System/Library/LaunchAgents/com.apple.coreservices.sharedfilelistd.plist"
  set strCommandText to ("/bin/launchctl stop -w \"" & strAgentPath & "\"")
  try
do shell script strCommandText
  end try
  set strCommandText to ("/bin/launchctl start -w \"" & strAgentPath & "\"")
  try
do shell script strCommandText
  end try
end try
delay 0.5
do shell script "/usr/bin/killall Finder"

return


|

[LSSharedFileList]サーバーへ接続のよく使うサーバーを追加

20240312070809_972x462

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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
(*
サーバーに接続の
よく使うサーバーを追加します
macOS14以降のsfl3版です
ゲストは
SMBなら
smb://guest:guest@192.168.0.XX:445/Shared
AFPなら
afp://;AUTH=No User Authent@192.168.0.XX:548/Shared

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

#############################################
###設定項目
#############################################
###追加するサーバーURL
set strSetURL to ("smb://guest:guest@192.168.0.1:445/Shared") as text



#######################################
##NSdataに読み込み Keyを解凍する
#######################################
set appFileManager to refMe's NSFileManager's defaultManager()
###処理するファイル名
set strFileName to "com.apple.LSSharedFileList.FavoriteServers.sfl3" as text
###URLに
set ocidURLArray to (appFileManager's URLsForDirectory:(refMe's NSApplicationSupportDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidAppSuppDirPathURL to ocidURLArray's firstObject()
set ocidContainerPathURL to (ocidAppSuppDirPathURL's URLByAppendingPathComponent:("com.apple.sharedfilelist") isDirectory:true)
set ocidSharedFileListURL to (ocidContainerPathURL's URLByAppendingPathComponent:(strFileName) isDirectory:false)
###NSDATAに読み込みます
set ocidPlistData to (refMe's NSData's dataWithContentsOfURL:(ocidSharedFileListURL))
### 解凍してDictに Flozenなので値を変更するために 可変に変えます
#NSKeyedUnarchiver's  OS13までの方式
# set ocidArchveDict to (refMe's NSKeyedUnarchiver's unarchiveObjectWithData:(ocidPlistData))
#NSKeyedUnarchiver's  OS14からの方式
set listResponse to refMe's NSKeyedUnarchiver's unarchivedObjectOfClass:((refMe's NSObject)'s class) fromData:(ocidPlistData) |error|:(reference)
set ocidArchveDict to (item 1 of listResponse)
### 可変Dictにセット
set ocidArchveDictM to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
(ocidArchveDictM's setDictionary:ocidArchveDict)

#######################################
### items の処理
#######################################
### items のArrayを取り出して Flozenなので値を変更するために 可変に変えます
set ocidItemsArray to (ocidArchveDictM's objectForKey:("items"))
### 項目入替用のArray 
set ocidItemsArrayM to (refMe's NSMutableArray's alloc()'s initWithCapacity:0)
(ocidItemsArrayM's setArray:ocidItemsArray)
set numCntArrayItem to count of ocidItemsArray
#######################################
### 値がすでにあるか?確認
set boolChkTagName to (missing value)
##################
###itemsの数だけ繰り返し
repeat with itemsArrayDict in ocidItemsArrayM
  ####
  set strItemName to (itemsArrayDict's objectForKey:("Name")) as text
  if strItemName is strSetURL then
    ###値があった場合
    set boolChkTagName to true as boolean
    exit repeat
  else
    ###なかった場合
    set boolChkTagName to false as boolean
  end if
end repeat

#######################################
### 本処理項目の追加
#######################################

###なければ追加
if boolChkTagName is false then
  ######## 【1】項目追加用のDict
  set ocidAddDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
  ######## CustomItemProperties
  #【2】CustomItemProperties用のDICT
  set ocidCustomPropertiesDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
  #
  set ocidSetValue to refMe's NSString's stringWithString:("srvr")
ocidCustomPropertiesDict's setValue:(ocidSetValue) forKey:("com.apple.LSSharedFileList.OverrideIcon.OSType")
  #【1】のDICTに追加
ocidAddDict's setObject:(ocidCustomPropertiesDict) forKey:("CustomItemProperties")
  ######## 追加用のDict root
  ## Name
  set ocidSetValue to refMe's NSString's stringWithString:(strSetURL)
ocidAddDict's setObject:(ocidSetValue) forKey:("Name")
  ## uuid
  set ocidUUID to refMe's NSUUID's alloc()'s init()
  set ocidUUIDString to ocidUUID's UUIDString()
ocidAddDict's setValue:(ocidUUIDString) forKey:("uuid")
  ## visibility
  set ocidVisibility to refMe's NSNumber's numberWithInteger:(0)
ocidAddDict's setValue:(ocidVisibility) forKey:("visibility")
  ## Bookmark
  set ocidURLString to refMe's NSString's stringWithString:(strSetURL)
  set ocidURL to refMe's NSURL's alloc()'s initWithString:(ocidURLString)
  set listBookMarkData to (ocidURL's bookmarkDataWithOptions:(11) includingResourceValuesForKeys:({missing value}) relativeToURL:(missing value) |error|:(reference))
  set ocidBookMarkData to (item 1 of listBookMarkData)
ocidAddDict's setObject:(ocidBookMarkData) forKey:("Bookmark")
  
  ##itemsのArrayに追加
ocidItemsArrayM's addObject:(ocidAddDict)
end if
### RootにItemsを追加
(ocidArchveDictM's setObject:(ocidItemsArrayM) forKey:("items"))

#######################################
### 値が新しくなった解凍済みDictをアーカイブする
#######################################
##NSKeyedArchiverに戻す OS13までの形式
# set listSaveData to (refMe's NSKeyedArchiver's archivedDataWithRootObject:(ocidArchveDictM) requiringSecureCoding:(true) |error|:(reference))
##NSKeyedArchiver OS14からの形式
set listSaveData to refMe's NSKeyedArchiver's archivedDataWithRootObject:(ocidArchveDictM) requiringSecureCoding:(false) |error|:(reference)
set ocidSaveData to item 1 of listSaveData

#######################################
### データを上書き保存する
#######################################
##保存
set listDone to ocidSaveData's writeToURL:(ocidSharedFileListURL) options:0 |error|:(reference)

#######################################
### リロード
#######################################
try
do shell script "/usr/bin/killall sharedfilelistd"
on error
  set strAgentPath to "/System/Library/LaunchAgents/com.apple.coreservices.sharedfilelistd.plist"
  set strCommandText to ("/bin/launchctl stop -w \"" & strAgentPath & "\"")
  try
do shell script strCommandText
  end try
  set strCommandText to ("/bin/launchctl start -w \"" & strAgentPath & "\"")
  try
do shell script strCommandText
  end try
end try
delay 0.5
## do shell script "/usr/bin/killall Finder"

return


|

[LSSharedFileList]Finderサイドバーのよく使う項目を追加する

20240312072816_1272x780

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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
(*
サーバーに接続の
よく使うサーバーを追加します
macOS14以降のsfl3版です
AirDrop
nwnode://domain-AirDrop
一部個別のスキームがあります

*)
----+----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 strAddDirPath to ("~/Downloads") as text

###
set ocidAddDirPathStr to refMe's NSString's stringWithString:(strAddDirPath)
set ocidAddDirPath to ocidAddDirPathStr's stringByStandardizingPath()
set ocidAddDirPathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidAddDirPath) isDirectory:false)
set strAddDirPath to ocidAddDirPathURL's absoluteString() as text

#######################################
##NSdataに読み込み Keyを解凍する
#######################################
set appFileManager to refMe's NSFileManager's defaultManager()
###処理するファイル名
set strFileName to "com.apple.LSSharedFileList.FavoriteItems.sfl3" as text
###URLに
set ocidURLArray to (appFileManager's URLsForDirectory:(refMe's NSApplicationSupportDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidAppSuppDirPathURL to ocidURLArray's firstObject()
set ocidContainerPathURL to (ocidAppSuppDirPathURL's URLByAppendingPathComponent:("com.apple.sharedfilelist") isDirectory:true)
set ocidSharedFileListURL to (ocidContainerPathURL's URLByAppendingPathComponent:(strFileName) isDirectory:false)
###NSDATAに読み込みます
set ocidPlistData to (refMe's NSData's dataWithContentsOfURL:(ocidSharedFileListURL))
### 解凍してDictに Flozenなので値を変更するために 可変に変えます
#NSKeyedUnarchiver's  OS13までの方式
# set ocidArchveDict to (refMe's NSKeyedUnarchiver's unarchiveObjectWithData:(ocidPlistData))
#NSKeyedUnarchiver's  OS14からの方式
set listResponse to refMe's NSKeyedUnarchiver's unarchivedObjectOfClass:((refMe's NSObject)'s class) fromData:(ocidPlistData) |error|:(reference)
set ocidArchveDict to (item 1 of listResponse)
### 可変Dictにセット
set ocidArchveDictM to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
(ocidArchveDictM's setDictionary:ocidArchveDict)

#######################################
### items の処理
#######################################
### items のArrayを取り出して Flozenなので値を変更するために 可変に変えます
set ocidItemsArray to (ocidArchveDictM's objectForKey:("items"))
### 項目入替用のArray 
set ocidItemsArrayM to (refMe's NSMutableArray's alloc()'s initWithCapacity:0)
(ocidItemsArrayM's setArray:ocidItemsArray)
set numCntArrayItem to count of ocidItemsArray
#######################################
### 値がすでにあるか?確認
set boolChkTagName to (missing value)
##################
###itemsの数だけ繰り返し
repeat with itemsArrayDict in ocidItemsArrayM
  ####
  set ocidBookMarkData to (itemsArrayDict's objectForKey:("Bookmark"))
  #BOOKMarkデータの解凍
  set listResponse to (refMe's NSURL's URLByResolvingBookmarkData:(ocidBookMarkData) options:(refMe's NSURLBookmarkResolutionWithoutUI) relativeToURL:(missing value) bookmarkDataIsStale:(missing value) |error|:(reference))
  set ocidBookMarkURL to (item 1 of listResponse)
  set strBookMarkPath to ocidBookMarkURL's absoluteString() as text
  ##
  if strAddDirPath is strBookMarkPath then
    ###値があった場合
    set boolChkTagName to true as boolean
    exit repeat
  else
    ###なかった場合
    set boolChkTagName to false as boolean
  end if
end repeat

#######################################
### 本処理項目の追加
#######################################

###なければ追加
if boolChkTagName is false then
  ######## 【1】項目追加用のDict
  set ocidAddDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
  ######## CustomItemProperties
  #【2】CustomItemProperties用のDICT
  set ocidCustomPropertiesDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
  # 0=true 1=false
  set ocidSetValue to (refMe's NSNumber's numberWithInteger:1)
ocidCustomPropertiesDict's setValue:(ocidSetValue) forKey:("com.apple.LSSharedFileList.ItemIsHidden")
  # 0=true 1=false
  set ocidSetValue to (refMe's NSNumber's numberWithInteger:0)
ocidCustomPropertiesDict's setValue:(ocidSetValue) forKey:("com.apple.finder.dontshowonreappearance")
  
  #【1】のDICTに追加
ocidAddDict's setObject:(ocidCustomPropertiesDict) forKey:("CustomItemProperties")
  ######## 追加用のDict root
  ## uuid
  set ocidUUID to refMe's NSUUID's alloc()'s init()
  set ocidUUIDString to ocidUUID's UUIDString()
ocidAddDict's setValue:(ocidUUIDString) forKey:("uuid")
  ## visibility
  set ocidVisibility to refMe's NSNumber's numberWithInteger:(0)
ocidAddDict's setValue:(ocidVisibility) forKey:("visibility")
  ## Bookmark
  set listBookMarkData to (ocidAddDirPathURL's bookmarkDataWithOptions:(11) includingResourceValuesForKeys:({missing value}) relativeToURL:(missing value) |error|:(reference))
  set ocidBookMarkData to (item 1 of listBookMarkData)
ocidAddDict's setObject:(ocidBookMarkData) forKey:("Bookmark")
  
  ##itemsのArrayに追加
ocidItemsArrayM's addObject:(ocidAddDict)
end if
### RootにItemsを追加
(ocidArchveDictM's setObject:(ocidItemsArrayM) forKey:("items"))

#######################################
### 値が新しくなった解凍済みDictをアーカイブする
#######################################
##NSKeyedArchiverに戻す OS13までの形式
# set listSaveData to (refMe's NSKeyedArchiver's archivedDataWithRootObject:(ocidArchveDictM) requiringSecureCoding:(true) |error|:(reference))
##NSKeyedArchiver OS14からの形式
set listSaveData to refMe's NSKeyedArchiver's archivedDataWithRootObject:(ocidArchveDictM) requiringSecureCoding:(false) |error|:(reference)
set ocidSaveData to item 1 of listSaveData

#######################################
### データを上書き保存する
#######################################
##保存
set listDone to ocidSaveData's writeToURL:(ocidSharedFileListURL) options:0 |error|:(reference)

#######################################
### リロード
#######################################
try
do shell script "/usr/bin/killall sharedfilelistd"
on error
  set strAgentPath to "/System/Library/LaunchAgents/com.apple.coreservices.sharedfilelistd.plist"
  set strCommandText to ("/bin/launchctl stop -w \"" & strAgentPath & "\"")
  try
do shell script strCommandText
  end try
  set strCommandText to ("/bin/launchctl start -w \"" & strAgentPath & "\"")
  try
do shell script strCommandText
  end try
end try
delay 0.5
## do shell script "/usr/bin/killall Finder"

return


|

[NSKeyedArchiver]plistをsfl3形式にKeyedArchiveする


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

#!/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 "AppKit"
use scripting additions
property refMe : a reference to current application

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

###################################
#####ファイル選択ダイアログ
###################################
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
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
####ダイアログを出す
set listUTI to {"com.apple.property-list"} as list
set aliasFilePath to (choose file with prompt "plistファイルを選んでください" default location (aliasDefaultLocation) of type listUTI with invisibles and showing package contents without multiple selections allowed) as alias
####入力ファイルパス
set strFilePath to POSIX path of aliasFilePath
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 ocidBaseFilePathURL to ocidFilePathURL's URLByDeletingPathExtension()
set ocidPrefixName to ocidBaseFilePathURL's lastPathComponent()
###################################
#####保存先ダイアログ
###################################
###ファイル名
set strPrefixName to ocidPrefixName as text
###拡張子変える場合
set strFileExtension to "sfl3"
###ダイアログに出すファイル名
set strDefaultName to (strPrefixName & "." & strFileExtension) as text
set strPromptText to "名前を決めてください"
set strMesText to "名前を決めてください"
####
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

####実在しない『はず』なのでas «class furl»で
set aliasSaveFilePath to (choose file name strMesText default location aliasDefaultLocation default name strDefaultName with prompt strPromptText) as «class furl»
####UNIXパス
set strSaveFilePath to POSIX path of aliasSaveFilePath as text
####ドキュメントのパスをNSString
set ocidSaveFilePath to refMe's NSString's stringWithString:strSaveFilePath
####ドキュメントのパスをNSURLに
set ocidSaveFilePathURL to refMe's NSURL's fileURLWithPath:ocidSaveFilePath
###拡張子取得
set strFileExtensionName to ocidSaveFilePathURL's pathExtension() as text
###ダイアログで拡張子を取っちゃった時対策
if strFileExtensionName is not strFileExtension then
  set ocidSaveFilePathURL to ocidSaveFilePathURL's URLByAppendingPathExtension:(strFileExtension)
end if

###################################
#####本処理
###################################
# DICTに読み込んで
set listResponse to refMe's NSDictionary's alloc()'s initWithContentsOfURL:(ocidFilePathURL) |error|:(reference)
set ocidReadData to (item 1 of listResponse)
#アーカイブする
#
set listResponse to refMe's NSKeyedArchiver's archivedDataWithRootObject:(ocidReadData) requiringSecureCoding:(false) |error|:(reference)
set ocidSfl3Data to (item 1 of listResponse)
if ocidSfl3Data = (missing value) then
return "アーカイブに失敗しました"
end if


#ファイル保存
set listDone to ocidSfl3Data's writeToURL:(ocidSaveFilePathURL) options:0 |error|:(reference)



|

[基本]NSKeyedArchiver

1:NSKeyedArchiverアーカイブ
2:NSKeyedUnarchiverアン・アーカイブ(ここでは、解凍と呼ぶことにします)



1:NSKeyedArchiverアーカイブ
[基本 NSKeyedArchiver] 1:NSKeyedArchiver アーカイブする
https://quicktimer.cocolog-nifty.com/icefloe/2023/09/post-e62bae.html


2:NSKeyedUnarchiver解凍
[基本 NSKeyedArchiver] 2:NSKeyedUnarchiver アン・アーカイブ解凍する
https://quicktimer.cocolog-nifty.com/icefloe/2023/09/post-c324cb.html

|

[基本 NSKeyedArchiver] 2:NSKeyedUnarchiver アン・アーカイブ解凍する

NSKeyedArchiverされた こんなデータを Screen-20230918-182132 解凍してキーと値のPLIST形式にします Screen-20230918-182015

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

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

property refMe : a reference to current application

####【1】読み込むPLISTのパス
#アーカイブされたPlistのパス
set strFilePath to "~/Desktop/com.apple.archiveutility.plist" 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)

####【2】PLISTのデータをNSDATAに読み込み
set ocidPlistDictData to refMe's NSData's dataWithContentsOfURL:(ocidFilePathURL)
####【3】解凍する
set ocidPlistArchiver to refMe's NSKeyedUnarchiver's unarchivedObjectOfClass:(refMe's NSDictionary's class) fromData:(ocidPlistDictData) |error|:(missing value)
log ocidPlistArchiver as record

####【4】出力ファイルパス デスクトップ ファイルは削除してもOKです
set strSaveFilePath to "~/Desktop/com.apple.archiveutility.Unarchiver.plist" as text
set ocidSaveFilePathStr to refMe's NSString's stringWithString:(strSaveFilePath)
set ocidSaveFilePath to ocidSaveFilePathStr's stringByStandardizingPath()
set ocidSaveFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidSaveFilePath) isDirectory:false)

####【5】保存
set boolDone to ocidPlistArchiver's writeToURL:(ocidSaveFilePathURL) atomically:yes





|

[基本 NSKeyedArchiver] 1:NSKeyedArchiver アーカイブする

こんな感じのPLISTが Screen-20230918-182015 こんな感じにアーカイブされます Screen-20230918-182132

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

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

property refMe : a reference to current application

####【1】読み込むPLISTのパス
#アーカイブユーティリティの初期設定ファイル
set strFilePath to "~/Library/Preferences/com.apple.archiveutility.plist.plist" 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)

####【2】PLISTのデータをNSDATAに読み込み
set ocidPlistDictData to refMe's NSData's dataWithContentsOfURL:(ocidFilePathURL)
####【3】キーアーカイブする
set listPlistArchiver to refMe's NSKeyedArchiver's archivedDataWithRootObject:(ocidPlistDictData) requiringSecureCoding:(false) |error|:(reference)
set ocidPlistArchiver to (item 1 of listPlistArchiver)

####【4】出力ファイルパス デスクトップ ファイルは削除してもOKです
set strSaveFilePath to "~/Desktop/com.apple.archiveutility.plist" as text
set ocidSaveFilePathStr to refMe's NSString's stringWithString:(strSaveFilePath)
set ocidSaveFilePath to ocidSaveFilePathStr's stringByStandardizingPath()
set ocidSaveFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidSaveFilePath) isDirectory:false)

####【5】保存
set boolDone to ocidPlistArchiver's writeToURL:(ocidSaveFilePathURL) atomically:yes





|

その他のカテゴリー

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