AppleScript Label

ラベル と タグ(macOS14対応)

Comapplelssharedfilelistprojectsitems001Comapplelssharedfilelistprojectsitems002Comapplelssharedfilelistprojectsitems003Comapplelssharedfilelistprojectsitems004



カテゴリー
ラベル タグ
https://quicktimer.cocolog-nifty.com/icefloe/cat76054827/index.html
NSKeyedArchiver
https://quicktimer.cocolog-nifty.com/icefloe/cat76056161/index.html
NSKeyedUnarchiver
https://quicktimer.cocolog-nifty.com/icefloe/cat76055043/index.html
LSSharedFileList (com.apple.LSSharedFileList.ProjectsItems.sfl3)
https://quicktimer.cocolog-nifty.com/icefloe/cat76055054/index.html


以下旧記事のコピー
202402200625551696x990

【A】ラベル
【B】タグ
【C】Label番号
【D】Spotlight検索ビュー
【E】Finderサイドバー
【F】保存済みの検索条件



【A】ラベル
ラベルは基本的には1ファイル1つ設定される
ラベルが複数設定の場合は、内容的には ラベル+複数指定ラベルタグになる
[Label]FInderラベルの色番号を取得する
https://quicktimer.cocolog-nifty.com/icefloe/2024/01/post-0329e2.html
[Label]FInderラベルの色番号を設定する
https://quicktimer.cocolog-nifty.com/icefloe/2024/01/post-ff0c42.html
[Label]FInderラベルの色番号を削除=0をセットする
https://quicktimer.cocolog-nifty.com/icefloe/2024/01/post-5311a4.html
[bash]FInderラベルの色番号を取得する
https://quicktimer.cocolog-nifty.com/icefloe/2024/01/post-361e8f.html


【A-1】ラベルなし
【A-2】ラベル単色
【A-3】ラベル複数色


【A-1】ラベルなし
[Label]FInderラベルの色番号を削除=0をセットする
https://quicktimer.cocolog-nifty.com/icefloe/2024/01/post-5311a4.html

2596759092ea2ef1b9b4a43b59400f0f08b36b44
【A-2】ラベル単色
[Label]FInderラベルの色番号を設定する
https://quicktimer.cocolog-nifty.com/icefloe/2024/01/post-ff0c42.html
259676018e95ff77bc54748809ade0ee7a493efa
【A-3】ラベル複数色
ラベル複数色=ラベル単色+色ラベルタグ×複数=複数色指定のラベルはタグになる
ラベル複数色を設定する
https://quicktimer.cocolog-nifty.com/icefloe/2023/11/post-c3386f.html
[xattr]コマンドラインからFinerラベルを設定する
https://quicktimer.cocolog-nifty.com/icefloe/2023/10/post-3f7802.html
2596760740dfab8339f9c4ccf80728972cdbc56f



【B】タグ

[xattr]コマンドラインからFinerラベルを設定する
https://quicktimer.cocolog-nifty.com/icefloe/2023/10/post-3f7802.html



【B-1】タグ無し
【B-2】色ラベル無しタグ
【B-3】色ラベル有りタグ
ラベル(色)指定のあるタグを作成する
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-7f83e9.html
【B-4】複数色ラベルタグ(ラベルのA-3ラベル複数色と同じ)
【macOS14】com.apple.LSSharedFileList.ProjectsItemsはsfl2からsfl3へ
圧縮 アーカイブは
NSKeyedArchiver
https://quicktimer.cocolog-nifty.com/icefloe/cat76056161/index.html
解凍 アン・アーカイブは
NSKeyedUnarchiver
https://quicktimer.cocolog-nifty.com/icefloe/cat76055043/index.html

参照してください


【B-1】タグ無し
[NSURLTagNamesKey]タグ削除
https://quicktimer.cocolog-nifty.com/icefloe/2023/11/post-4d8962.html
2596759092ea2ef1b9b4a43b59400f0f08b36b44
【B-2】色ラベル無しタグ
ラベル色無しのタグを設定する
https://quicktimer.cocolog-nifty.com/icefloe/2023/10/post-bb420b.html
25967658956a3651a800c4a158b91a603d329489
【B-3】色ラベル有りタグ

2596766509ba1c62a271c40678356cbddfa74111
【B-4】複数色ラベルタグ(ラベルのA-3ラベル複数色と同じ)
タグのみ設定する
https://quicktimer.cocolog-nifty.com/icefloe/2023/11/post-83a80b.html
2596760740dfab8339f9c4ccf80728972cdbc56f
【B-5】ラベルNO無し 色付きタグ指定あり
202403250606571334x986
ラベルNO無し 色付きタグ指定ありの ラベルとタグを削除する
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-28dd5f.html



【C】Label番号の違い(FinderラベルとOCで逆順)
2593688877a853ca3d34c4a7f8f354355f11353e


【D】Spotlight検索ビュー
設定SlicesRootAttributes
[com.apple.finder] SlicesRootAttributes
https://quicktimer.cocolog-nifty.com/icefloe/2022/05/post-a415d7.html
[Mobileconfig]SlicesRootAttributes
https://quicktimer.cocolog-nifty.com/icefloe/2022/06/post-e92079.html
[com.apple.finder] SlicesRootAttributes その2
https://quicktimer.cocolog-nifty.com/icefloe/2023/12/post-bd77fe.html
【D-A】ラベル kMDItemFSLabel
【D-B】タグ kMDItemUserTags


【D-A】ラベル kMDItemFSLabel
Screen_1_20240119150001
【D-B】タグ kMDItemUserTags
261828515a9b26ec9c0b94a218744894c21a5df8


【F】保存済みの検索条件
【F-1】ラベル kMDItemFSLabel
【F-2】タグ kMDItemUserTags

|

ラベルNO無し 色付きタグ指定ありの ラベルとタグを削除する

202403250606571334x986

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

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


##############################
### Wクリックで起動時
on run
  ###ドロップレットWクリック時にはファイル選択ダイアログを出す
  set strName to (name of current application) as text
  if strName is "osascript" then
    tell application "Finder" to activate
  else if strName is (name of me as text) then
    set strName to (name of me) as text
    tell application strName to activate
  else
    tell current application to activate
  end if
  ###デフォルトロケーションはデスクトップ
  set appFileManager to refMe's NSFileManager's defaultManager()
  set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
  set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
  set aliasDesktopDirPath to (ocidDesktopDirPathURL's absoluteURL()) as alias
  set strMes to "選んでください"
  set listDropOpenPath to (choose file strMes default location aliasDesktopDirPath with prompt strMes with multiple selections allowed and showing package contents without invisibles) as list
open listDropOpenPath
end run

##################################
###本処理
##################################
on open listDropOpenPath
  
  ######################################
  ###ProjectsItemsからラベル指定のあるタグを取得
  set strSfl3FileName to ("com.apple.LSSharedFileList.ProjectsItems.sfl3") as text
  set appFileManager to refMe's NSFileManager's defaultManager()
  set ocidURLArray to appFileManager's URLsForDirectory:(refMe's NSApplicationSupportDirectory) inDomains:(refMe's NSUserDomainMask)
  set ocidAppSuppDirPathURL to ocidURLArray's firstObject()
  set ocidSharedFilelistDirPathURL to ocidAppSuppDirPathURL's URLByAppendingPathComponent:("com.apple.sharedfilelist") isDirectory:true
  set ocidSfl3FilePathURL to ocidSharedFilelistDirPathURL's URLByAppendingPathComponent:(strSfl3FileName) isDirectory:false
  # NSDataに読み込んで
  set ocidOption to (refMe's NSDataReadingMappedIfSafe)
  set listReadData to refMe's NSData's dataWithContentsOfURL:(ocidSfl3FilePathURL) options:(ocidOption) |error|:(reference)
  if (item 2 of listReadData) is (missing value) then
    set ocidReadData to (item 1 of listReadData)
log "正常終了"
  else
log (item 2 of listReadData)'s localizedDescription() as text
return "失敗しました"
  end if
  # unarchivedObjectOfClassで解凍する
  set listReadData to refMe's NSKeyedUnarchiver's unarchivedObjectOfClass:((refMe's NSObject)'s class) fromData:(ocidReadData) |error|:(reference)
  if (item 2 of listReadData) is (missing value) then
    set ocidPlistDict to (item 1 of listReadData)
log "正常終了"
  else
log (item 2 of listReadData)'s localizedDescription() as text
return "失敗しました"
  end if
  # itemのkLSSharedTagFileListItemLabelがあるものを収集
  set ocidLabelColorDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
  ###items のArrayを取り出して
  set ocidItemsArray to ocidPlistDict's objectForKey:("items")
  repeat with itemDict in ocidItemsArray
    set coidTagName to (itemDict's valueForKey:("Name"))
    set ocidCustomItemPropertiesDict to (itemDict's objectForKey:("CustomItemProperties"))
    set ocidColorNO to (ocidCustomItemPropertiesDict's valueForKey:("kLSSharedTagFileListItemLabel"))
    if ocidColorNO ≠ (missing value) then
(ocidLabelColorDict's setValue:(ocidColorNO) forKey:(coidTagName))
    end if
  end repeat
log ocidLabelColorDict as record
  
  #ファイル ディレクトリの全てのパスの格納用
  set ocidFilePathURLArray to (refMe's NSMutableArray's alloc()'s initWithCapacity:0)
  #ドロップの数だけ繰り返し
  repeat with itemDropPath in listDropOpenPath
    ###ドップパス
    set appFileManager to refMe's NSFileManager's defaultManager()
    set strDropPath to (POSIX path of itemDropPath) as text
    set ocidDropPathStr to (refMe's NSString's stringWithString:(strDropPath))
    set ocidDropPath to ocidDropPathStr's stringByStandardizingPath()
    set ocidDropPathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidDropPath))
    ###ドロップされたのが?
    set listResults to (ocidDropPathURL's getResourceValue:(reference) forKey:(refMe's NSURLIsDirectoryKey) |error|:(reference))
    if (item 2 of listResults) = (refMe's NSNumber's numberWithBool:true) then
      # log "このURLはフォルダです"
      ##取得するプロパティ
      set ocidProperties to (refMe's NSMutableArray's alloc()'s initWithCapacity:0)
(ocidProperties's addObject:(refMe's NSURLPathKey))
      # (ocidProperties's addObject:(refMe's NSURLIsRegularFileKey))
      # (ocidProperties's addObject:(refMe's NSURLContentTypeKey))
      ##オプション(隠しファイルは含まない)
      set ocidOption to refMe's NSDirectoryEnumerationSkipsHiddenFiles
      ##コンテンツの収集
      set ocidEmuDict to (appFileManager's enumeratorAtURL:(ocidDropPathURL) includingPropertiesForKeys:(ocidProperties) options:(ocidOption) errorHandler:(reference))
      set ocidFilePathURLArray to ocidEmuDict's allObjects()
      #フォルダ自身も追加しておく
(ocidFilePathURLArray's addObject:(itemDropPath))
    else
      # log "このURLはファイルです"
(ocidFilePathURLArray's addObject:(itemDropPath))
    end if
  end repeat
  
  ###不要なんだが念のためパスをURL順に並び替え
  set ocidSortDescriptor to (refMe's NSSortDescriptor's sortDescriptorWithKey:"absoluteString" ascending:(true) selector:"localizedStandardCompare:")
(ocidFilePathURLArray's sortUsingDescriptors:{ocidSortDescriptor})
  
  repeat with itemFilePathURL in ocidFilePathURLArray
    ##########
    ##ラベル削除
    set listResult to (itemFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLLabelNumberKey) |error|:(reference))
    if (item 1 of listResult) is true then
      set ocidGetLabelNo to (item 2 of listResult)
    else
return "LabelNOの取得に失敗しました"
    end if
    set ocidSetLabelNo to (refMe's NSNumber's numberWithInt:(0))
    if ocidGetLabelNo ≠ ocidSetLabelNo then
      set listDone to (itemFilePathURL's setResourceValue:(ocidSetLabelNo) forKey:(refMe's NSURLLabelNumberKey) |error|:(reference))
      if (item 1 of listDone) = true then
log "ラベルを0に設定しました"
      else
log itemFilePathURL's |path| as text
log "ラベルの削除に失敗しました"
      end if
    else
log "ラベルは0が絶定されていました"
    end if
    
    set listResult to (itemFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLTagNamesKey) |error|:(reference))
    set ocidTagArray to (item 2 of listResult)
    set numCntTagArray to (count of ocidTagArray) as integer
    repeat with itemIntNo from (numCntTagArray - 1) to 0 by -1
      set ocidItemTagName to (ocidTagArray's objectAtIndex:(itemIntNo))
      set ocidLabelName to (ocidLabelColorDict's valueForKey:(ocidItemTagName))
      if ocidLabelName ≠ (missing value) then
(ocidTagArray's removeObjectAtIndex:(itemIntNo))
      end if
    end repeat
    set listDone to (itemFilePathURL's setResourceValue:(ocidTagArray) forKey:(refMe's NSURLTagNamesKey) |error|:(reference))
    if (item 1 of listDone) = true then
log "タグを削除しました"
    else
log "タグの削除に失敗しました"
    end if
    
  end repeat
  
end open

|

[NSURLTagNamesKey]Windows非互換文字のファイル名フォルダ名にタグ付(修正)

20240322035922384x192

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

#!/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
property refNSNotFound : a reference to 9.22337203685477E+18 + 5807
property listDeprecatedChar : {"\\", "/", "?", "<", ">", ":", "*", "|", "\"", "¥", ".."} as list

##############################
### Wクリックで起動時
on run
  ###ドロップレットWクリック時にはファイル選択ダイアログを出す
  set strName to (name of current application) as text
  if strName is "osascript" then
    tell application "Finder" to activate
  else if strName is (name of me as text) then
    set strName to (name of me) as text
    tell application strName to activate
  else
    tell current application to activate
  end if
  ###デフォルトロケーションはデスクトップ
  set appFileManager to refMe's NSFileManager's defaultManager()
  set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
  set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
  set aliasDesktopDirPath to (ocidDesktopDirPathURL's absoluteURL()) as alias
  set strMes to "選んでください"
  set listDropOpenPath to (choose folder strMes default location aliasDesktopDirPath with prompt strMes with multiple selections allowed and showing package contents without invisibles) as list
open listDropOpenPath
end run

##################################
###本処理
##################################
on open listDropOpenPath
  ##################################
  #サイドバー項目をチェック
  set strTagName to ("Windows非互換文字") as text
  set numLabelNo to 7 as integer
  ##
  set appFileManager to refMe's NSFileManager's defaultManager()
  set strFileName to "com.apple.LSSharedFileList.ProjectsItems.sfl3" as text
  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))
  ### NSKeyedUnarchiver's
  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)
  set ocidItemsArray to (ocidArchveDictM's objectForKey:("items"))
  set numCntArray to (count of ocidItemsArray) as integer
  set boolChkTagName to false as boolean
  repeat with itemIntNo from 0 to (numCntArray - 1) by 1
    set itemsArrayDict to (ocidItemsArray's objectAtIndex:(itemIntNo))
    set strItemName to (itemsArrayDict's objectForKey:("Name")) as text
    if strItemName is strTagName then
      set boolChkTagName to true as boolean
log "すでに設定済みです"
    end if
  end repeat
  if boolChkTagName is false then
    ### 項目追加用の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
    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"))
    ###NSKeyedArchiver's
    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)
    if (item 1 of listDone) is false then
log "保存に失敗しました"
    else
log "設定済しました"
    end if
  end if
  
  set ocidFilePathURLArray to (refMe's NSMutableArray's alloc()'s initWithCapacity:0)
  
  repeat with itemDropPath in listDropOpenPath
    ###ドップパス
    set appFileManager to refMe's NSFileManager's defaultManager()
    set strDropPath to (POSIX path of itemDropPath) as text
    set ocidDropPathStr to (refMe's NSString's stringWithString:(strDropPath))
    set ocidDropPath to ocidDropPathStr's stringByStandardizingPath()
    set ocidDropPathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidDropPath))
    ###ドロップされたのが?
    set listResults to (ocidDropPathURL's getResourceValue:(reference) forKey:(refMe's NSURLIsDirectoryKey) |error|:(reference))
    if (item 2 of listResults) = (refMe's NSNumber's numberWithBool:true) then
log "このURLはフォルダです"
      ##取得するプロパティ
      set ocidProperties to (refMe's NSMutableArray's alloc()'s initWithCapacity:0)
(ocidProperties's addObject:(refMe's NSURLPathKey))
(ocidProperties's addObject:(refMe's NSURLIsRegularFileKey))
(ocidProperties's addObject:(refMe's NSURLContentTypeKey))
      ##オプション(隠しファイルは含まない)
      set ocidOption to refMe's NSDirectoryEnumerationSkipsHiddenFiles
      ##コンテンツの収集
      set ocidEmuDict to (appFileManager's enumeratorAtURL:(ocidDropPathURL) includingPropertiesForKeys:(ocidProperties) options:(ocidOption) errorHandler:(reference))
      set ocidFilePathURLArray to ocidEmuDict's allObjects()
      #フォルダ自身も追加しておく
(ocidFilePathURLArray's addObject:(itemDropPath))
    else
log "このURLはファイルです"
(ocidFilePathURLArray's addObject:(itemDropPath))
    end if
  end repeat
  
  ###不要なんだが念のためパスをURL順に並び替え
  set ocidSortDescriptor to (refMe's NSSortDescriptor's sortDescriptorWithKey:"absoluteString" ascending:(true) selector:"localizedStandardCompare:")
(ocidFilePathURLArray's sortUsingDescriptors:{ocidSortDescriptor})
  
  set ocidDeprecatedArray to refMe's NSArray's arrayWithArray:(listDeprecatedChar)
  set ocidTagArray to (refMe's NSMutableArray's alloc()'s initWithCapacity:(0))
  set ocidTagName to (refMe's NSString's stringWithString:(strTagName))
(ocidTagArray's addObject:(ocidTagName))
  
  repeat with itemFilePathURL in ocidFilePathURLArray
    set ocidLastPath to itemFilePathURL's lastPathComponent()
    ##文字列の最初と最後のスペース
    set ocidCharLength to ocidLastPath's |length|()
    set ocidLastCharRange to refMe's NSMakeRange((ocidCharLength - 1), 1)
    set ocidFirstChar to (ocidLastPath's substringToIndex:(1)) as text
    set ocidLastChar to (ocidLastPath's substringWithRange:(ocidLastCharRange)) as text
    if ocidFirstChar is " " then
      set listDone to (itemFilePathURL's setResourceValue:(ocidTagArray) forKey:(refMe's NSURLTagNamesKey) |error|:(reference))
    end if
    if ocidLastChar is " " then
      set listDone to (itemFilePathURL's setResourceValue:(ocidTagArray) forKey:(refMe's NSURLTagNamesKey) |error|:(reference))
    end if
    ##非推奨文字チェック
    repeat with itemDeprecatedChar in ocidDeprecatedArray
      set ocidRange to (ocidLastPath's rangeOfString:(itemDeprecatedChar))
      set ocidLocation to ocidRange's location()
      if ocidLocation = refNSNotFound then
log "含まれていません"
      else
log "対象文字が含まれています"
        set listDone to (itemFilePathURL's setResourceValue:(ocidTagArray) forKey:(refMe's NSURLTagNamesKey) |error|:(reference))
      end if
    end repeat
  end repeat
  
  
end open

|

Windows非互換文字にタグ付け

2回チェックすると2こ同じタグがつくが、そこはご容赦
20240313031102500x266

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

#!/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
property refNotFound : a reference to 9.22337203685477E+18 + 5807
set appFileManager to refMe's NSFileManager's defaultManager()

#####################
# タグの有無のチェックと作成
#####################

set strTagName to ("Windows非互換文字") as text
#### LabelNumber
(*
0:ラベル無し
1:グレー
2:グリーン
3:パープル
4:ブルー
5:イエロー
6:レッド
7:オレンジ
*)
set numLabelNo to 5 as integer
#######タグのチェックと追加
#最初の1回だけで2回目からはコメントアウトしてOK
doMakeTagName(strTagName, numLabelNo)
##

###ファイル選択
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" to activate
else
  tell current application to activate
end if
set listUTI to {"public.item"}
set strMes to ("ファイルを選んでください") as text
set strPrompt to ("ファイルを選んでください") as text
try
  ### ファイル選択時
  set listAliasFilePath to (choose file strMes with prompt strPrompt default location (aliasDefaultLocation) of type listUTI with invisibles, showing package contents and multiple selections allowed) as list
on error
log "エラーしました"
return "エラーしました"
end try

##############################
###チェック対象文字列
##############################
###警告文字リスト
set listProhibit to {"\\", "¥", "<", ">", "*", "?", "\"", "|", "/", ":"} as list
###警告文字リストArrayに
set ocidListProhibitArray to (refMe's NSArray's alloc()'s initWithArray:(listProhibit))


repeat with itemAliasFilePath in listAliasFilePath
  set aliasFilePath to itemAliasFilePath as alias
  set strFilePath to (POSIX path of aliasFilePath) as text
  set ocidFilePathStr to (refMe's NSString's stringWithString:(strFilePath))
  set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
  set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:false)
  set ocidFileName to ocidFilePathURL's lastPathComponent()
  
  ###非互換文字があれば数だけカウントアップする
  set numChkProhibit to 0 as integer
  repeat with itemArray in ocidListProhibitArray
    #パス全体を調べる場合
    # set ocidFindRange to (ocidFilePath's rangeOfString:(itemArray))
    #ファイル名だけ調べる場合
    set ocidFindRange to (ocidFileName's rangeOfString:(itemArray))
    #結果
    if (ocidFindRange's location()) = refNotFound then
      ##カウンターはそのまま
      set numChkProhibit to numChkProhibit as integer
      ##非互換文字がある
    else if (ocidFindRange's |length|()) > 0 then
      ##カウンターを1加算
      set numChkProhibit to numChkProhibit + 1 as integer
    end if
  end repeat
  #######################################
  ## 非互換文字があった場合の処理
  if numChkProhibit > 0 then
    #####################
    #現在設定されている値を取得
    set listResult to (ocidFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLTagNamesKey) |error|:(reference))
    set ocidTagArray to (item 2 of listResult)
    if ocidTagArray = (missing value) then
log "タグは設定されていません"
      #タグの名前
      set ocidTagArray to (refMe's NSMutableArray's alloc()'s initWithCapacity:(0))
      set ocidTagName to (refMe's NSString's stringWithString:(strTagName))
(ocidTagArray's addObject:(ocidTagName))
    else
      set ocidTagName to (refMe's NSString's stringWithString:(strTagName))
(ocidTagArray's addObject:(ocidTagName))
    end if
    ###タグをセット=タグにラベル色指定があるので色付きタグが付与される
    set listDone to (ocidFilePathURL's setResourceValue:(ocidTagArray) forKey:(refMe's NSURLTagNamesKey) |error|:(reference))
    
  end if
  
end repeat



to doMakeTagName(argTagName, argLabelNo)
  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
  set strName to argTagName as text
  set numLabelNo to argLabelNo as integer
  #######################################
  ##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)
  ##################
  ###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
  
  #######################################
  ### タグがない場合は作る
  #######################################
  if boolChkTagName is false then
    ### 項目追加用の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
      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
  end if
  
  
end doMakeTagName


|

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


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

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


|

sfltool


#!/bin/bash
#com.cocolog-nifty.quicktimer.icefloe
## 詳細を出力

STR_DATE=$(date +%Y%m%d)
STR_DIST_FIEPATH="$HOME/Documents/Apple/BackgroundItems/$STR_DATE/"
/bin/mkdir -p "$STR_DIST_FIEPATH"
STR_SAVE_FILE_PATH="$HOME/Documents/Apple/BackgroundItems/$STR_DATE.txt"

/usr/bin/sudo /usr/bin/sfltool dumpbtm > "$STR_SAVE_FILE_PATH"

/usr/bin/sudo /usr/bin/sfltool archive -z  "$STR_DIST_FIEPATH"

exit 0

#!/bin/bash
#com.cocolog-nifty.quicktimer.icefloe
## 詳細を出力


/usr/bin/sudo /usr/bin/sfltool resetlist com.apple.LSSharedFileList.RecentApplications
##リストのリセット 対象ファイルを削除しますので より完全なリセットになります
##ファイルが削除されますので 表示数等の設定数がデフォルト値の10になります
## 最近つかった項目>書類
/usr/bin/sudo /usr/bin/sfltool resetlist com.apple.LSSharedFileList.RecentDocuments
## 最近つかった項目>アプリケーション
/usr/bin/sudo /usr/bin/sfltool resetlist com.apple.LSSharedFileList.RecentApplications
##最近使った項目>サーバー
/usr/bin/sudo /usr/bin/sfltool resetlist com.apple.LSSharedFileList.RecentServers
##サーバーに接続>URL入力部に表示される最近つかった項目
/usr/bin/sudo /usr/bin/sfltool resetlist com.apple.LSSharedFileList.RecentHosts

exit 0


#!/bin/bash
#com.cocolog-nifty.quicktimer.icefloe
##項目のリセット  値をクリアするだけでファイルや設定は残る
## 最近つかった項目>書類
/usr/bin/sudo /usr/bin/sfltool clear com.apple.LSSharedFileList.RecentDocuments
## 最近つかった項目>アプリケーション
/usr/bin/sudo /usr/bin/sfltool clear com.apple.LSSharedFileList.RecentApplications

##最近使った項目>サーバー
/usr/bin/sudo /usr/bin/sfltool clear com.apple.LSSharedFileList.RecentServers
##サーバーに接続>URL入力部に表示される最近つかった項目
/usr/bin/sudo /usr/bin/sfltool clear com.apple.LSSharedFileList.RecentHosts


exit 0


#!/bin/bash
#com.cocolog-nifty.quicktimer.icefloe
## 一覧出力
/usr/bin/sfltool list

exit 0


#!/bin/bash
#com.cocolog-nifty.quicktimer.icefloe
## 一覧出力
/usr/bin/sfltool list

exit 0
com.apple.LSSharedFileList.RecentServers
com.apple.LSSharedFileList.SharePoints
com.apple.LSSharedFileList.FavoriteItems
com.apple.LSSharedFileList.SavedSearches
com.apple.LSSharedFileList.ManagedShared
com.apple.LSSharedFileList.RecentHosts
com.apple.LSSharedFileList.RecentDocuments
com.apple.LSSharedFileList.SessionLoginItems
com.apple.LSSharedFileList.AutomountedServers
com.apple.LSSharedFileList.SFLLaunchdJobs
com.apple.LSSharedFileList.SFLServiceManagementLoginItems
com.apple.LSSharedFileList.FavoriteServers
com.apple.LSSharedFileList.FavoriteVolumes
com.apple.LSSharedFileList.ApplicationRecentDocuments
com.apple.LSSharedFileList.iCloudItems
com.apple.LSSharedFileList.DockApplications
com.apple.LSSharedFileList.GlobalLoginItems
com.apple.LSSharedFileList.RecentApplications
com.apple.LSSharedFileList.NetworkBrowser
com.apple.LSSharedFileList.ProjectsItems
com.apple.LSSharedFileList.ManagedSessionLoginItems

#!/bin/bash
#com.cocolog-nifty.quicktimer.icefloe
## 詳細を出力
/usr/bin/sudo /usr/bin/sfltool dumpbtm


#!/bin/bash
#com.cocolog-nifty.quicktimer.icefloe
##項目のリセット
## 最近つかった項目>書類
/usr/bin/sudo /usr/bin/sfltool clear com.apple.LSSharedFileList.RecentDocuments
## 最近つかった項目>サーバー
/usr/bin/sudo /usr/bin/sfltool clear com.apple.LSSharedFileList.RecentHosts
## 最近つかった項目>アプリケーション
/usr/bin/sudo /usr/bin/sfltool clear com.apple.LSSharedFileList.RecentApplications


|

[LSSharedFileList.ProjectsItems]タグの有無のチェック(macOS14 sfl3対応)


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

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

#######################################
##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"))
##################
###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
log "指定の名称のタグがすでにあります"
    exit repeat
  else
    ###なかった場合
    set boolChkTagName to false as boolean
  end if
end repeat


return boolChkTagName

|

ラベル タグ 全部削除(ファイル選択式 修正)


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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
# フォルダ内のコンテンツを収集して内包されている項目全部処理する
# NSURLTagNamesKeyに空のArrayをセットでも良かったが
# 後日特定のタグだけ削除とかに使いたいので個別で処理する方式にした
# ラベル も タグも全部削除します
#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


##############################
### Wクリックで起動時
on run
  ###ドロップレットWクリック時にはファイル選択ダイアログを出す
  set strName to (name of current application) as text
  if strName is "osascript" then
    tell application "Finder" to activate
  else if strName is (name of me as text) then
    set strName to (name of me) as text
    tell application strName to activate
  else
    tell current application to activate
  end if
  ###デフォルトロケーションはデスクトップ
  set appFileManager to refMe's NSFileManager's defaultManager()
  set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
  set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
  set aliasDesktopDirPath to (ocidDesktopDirPathURL's absoluteURL()) as alias
  set strMes to "選んでください"
  set listDropOpenPath to (choose file strMes default location aliasDesktopDirPath with prompt strMes with multiple selections allowed and showing package contents without invisibles) as list
open listDropOpenPath
end run

##################################
###本処理
##################################
on open listDropOpenPath
  #ファイル ディレクトリの全てのパスの格納用
  set ocidFilePathURLArray to (refMe's NSMutableArray's alloc()'s initWithCapacity:0)
  #ドロップの数だけ繰り返し
  repeat with itemDropPath in listDropOpenPath
    ###ドップパス
    set appFileManager to refMe's NSFileManager's defaultManager()
    set strDropPath to (POSIX path of itemDropPath) as text
    set ocidDropPathStr to (refMe's NSString's stringWithString:(strDropPath))
    set ocidDropPath to ocidDropPathStr's stringByStandardizingPath()
    set ocidDropPathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidDropPath))
    ###ドロップされたのが?
    set listResults to (ocidDropPathURL's getResourceValue:(reference) forKey:(refMe's NSURLIsDirectoryKey) |error|:(reference))
    if (item 2 of listResults) = (refMe's NSNumber's numberWithBool:true) then
      # log "このURLはフォルダです"
      ##取得するプロパティ
      set ocidProperties to (refMe's NSMutableArray's alloc()'s initWithCapacity:0)
(ocidProperties's addObject:(refMe's NSURLPathKey))
      # (ocidProperties's addObject:(refMe's NSURLIsRegularFileKey))
      # (ocidProperties's addObject:(refMe's NSURLContentTypeKey))
      ##オプション(隠しファイルは含まない)
      set ocidOption to refMe's NSDirectoryEnumerationSkipsHiddenFiles
      ##コンテンツの収集
      set ocidEmuDict to (appFileManager's enumeratorAtURL:(ocidDropPathURL) includingPropertiesForKeys:(ocidProperties) options:(ocidOption) errorHandler:(reference))
      set ocidFilePathURLArray to ocidEmuDict's allObjects()
      #フォルダ自身も追加しておく
(ocidFilePathURLArray's addObject:(itemDropPath))
    else
      # log "このURLはファイルです"
(ocidFilePathURLArray's addObject:(itemDropPath))
    end if
  end repeat
  
  ###不要なんだが念のためパスをURL順に並び替え
  set ocidSortDescriptor to (refMe's NSSortDescriptor's sortDescriptorWithKey:"absoluteString" ascending:(true) selector:"localizedStandardCompare:")
(ocidFilePathURLArray's sortUsingDescriptors:{ocidSortDescriptor})
  
  repeat with itemFilePathURL in ocidFilePathURLArray
    ##########
    
    ############
    ##設定されているタグの名前を取得して
    set listResult to (itemFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLTagNamesKey) |error|:(reference))
    set ocidTagArray to (item 2 of listResult)
log ocidTagArray as list
    if ocidTagArray = (missing value) then
log "タグは設定されていません"
    else
      #空のARRAYをセットする場合用
      #set ocidSetTagArray to refMe's NSArray's alloc()'s init()
      #取得したタグの数だけくりかえし
      set numCntTagArray to (count of ocidTagArray) as integer
      #Arrayの削除はIndexの大きい方から
      repeat with itemIntNo from (numCntTagArray - 1) to 0 by -1
(ocidTagArray's removeObjectAtIndex:(itemIntNo))
      end repeat
      ##removeAllObjectsでも良かった
      #ocidTagArray's removeAllObjects()
      #取得したタグの数だけくりかえし
      # repeat with itemTag in ocidTagArray
      #タグを削除して
      # (ocidTagArray's removeObject:(itemTag))
      # end repeat
      #削除したタグArrayを戻す
      set listDone to (itemFilePathURL's setResourceValue:(ocidTagArray) forKey:(refMe's NSURLTagNamesKey) |error|:(reference))
      if (item 1 of listDone) = true then
        # log "タグを削除しました"
      else
        # log itemFilePathURL's |path| as text
        # log "タグの削除に失敗しました"
      end if
    end if
    ##ラベル削除
    set listResult to (itemFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLLabelNumberKey) |error|:(reference))
    set ocidGetLabelNo to (item 2 of listResult)
log ocidGetLabelNo as text
    set ocidSetLabelNo to (refMe's NSNumber's numberWithInt:(0))
    if ocidGetLabelNo ≠ ocidSetLabelNo then
      set listDone to (itemFilePathURL's setResourceValue:(ocidSetLabelNo) forKey:(refMe's NSURLLabelNumberKey) |error|:(reference))
      if (item 1 of listDone) = true then
        # log "ラベルを0に設定しました"
      else
        # log itemFilePathURL's |path| as text
        # log "ラベルの削除に失敗しました"
      end if
    else
      # log "ラベルは0が絶定されていました"
    end if
  end repeat
  
end open

|

ラベル タグ 全部削除(フォルダ選択式 修正)


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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
# フォルダ内のコンテンツを収集して内包されている項目全部処理する
# NSURLTagNamesKeyに空のArrayをセットでも良かったが
# 後日特定のタグだけ削除とかに使いたいので個別で処理する方式にした
# ラベル も タグも全部削除します
#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


##############################
### Wクリックで起動時
on run
  ###ドロップレットWクリック時にはファイル選択ダイアログを出す
  set strName to (name of current application) as text
  if strName is "osascript" then
    tell application "Finder" to activate
  else if strName is (name of me as text) then
    set strName to (name of me) as text
    tell application strName to activate
  else
    tell current application to activate
  end if
  ###デフォルトロケーションはデスクトップ
  set appFileManager to refMe's NSFileManager's defaultManager()
  set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
  set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
  set aliasDesktopDirPath to (ocidDesktopDirPathURL's absoluteURL()) as alias
  set strMes to "選んでください"
  set listDropOpenPath to (choose folder strMes default location aliasDesktopDirPath with prompt strMes with multiple selections allowed and showing package contents without invisibles) as list
open listDropOpenPath
end run

##################################
#本処理
on open listDropOpenPath
  ##################################
  ###ファイル ディレクトリの全てのパスの格納用
  set ocidFilePathURLArray to (refMe's NSMutableArray's alloc()'s initWithCapacity:0)
  #ドロップの数だけ繰り返し
  repeat with itemDropPath in listDropOpenPath
    ###ドップパス
    set appFileManager to refMe's NSFileManager's defaultManager()
    set strDropPath to (POSIX path of itemDropPath) as text
    set ocidDropPathStr to (refMe's NSString's stringWithString:(strDropPath))
    set ocidDropPath to ocidDropPathStr's stringByStandardizingPath()
    set ocidDropPathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidDropPath))
    ###ドロップされたのが?
    set listResults to (ocidDropPathURL's getResourceValue:(reference) forKey:(refMe's NSURLIsDirectoryKey) |error|:(reference))
    if (item 2 of listResults) = (refMe's NSNumber's numberWithBool:true) then
      # log "このURLはフォルダです"
      ##取得するプロパティ
      set ocidProperties to (refMe's NSMutableArray's alloc()'s initWithCapacity:0)
(ocidProperties's addObject:(refMe's NSURLPathKey))
      # (ocidProperties's addObject:(refMe's NSURLIsRegularFileKey))
      # (ocidProperties's addObject:(refMe's NSURLContentTypeKey))
      ##オプション(隠しファイルは含まない)
      set ocidOption to refMe's NSDirectoryEnumerationSkipsHiddenFiles
      ##コンテンツの収集
      set ocidEmuDict to (appFileManager's enumeratorAtURL:(ocidDropPathURL) includingPropertiesForKeys:(ocidProperties) options:(ocidOption) errorHandler:(reference))
      set ocidFilePathURLArray to ocidEmuDict's allObjects()
      #フォルダ自身も追加しておく
(ocidFilePathURLArray's addObject:(itemDropPath))
    else
      # log "このURLはファイルです"
(ocidFilePathURLArray's addObject:(itemDropPath))
    end if
  end repeat
  
  ###不要なんだが念のためパスをURL順に並び替え
  set ocidSortDescriptor to (refMe's NSSortDescriptor's sortDescriptorWithKey:"absoluteString" ascending:(true) selector:"localizedStandardCompare:")
(ocidFilePathURLArray's sortUsingDescriptors:{ocidSortDescriptor})
  
  repeat with itemFilePathURL in ocidFilePathURLArray
    ##設定されているタグの名前を取得して
    set listResult to (itemFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLTagNamesKey) |error|:(reference))
    set ocidTagArray to (item 2 of listResult)
    if ocidTagArray = (missing value) then
log "タグは設定されていません"
    else
      #空のARRAYをセットする場合用
      #set ocidSetTagArray to refMe's NSArray's alloc()'s init()
      #取得したタグの数だけくりかえし
      set numCntTagArray to (count of ocidTagArray) as integer
      #Arrayの削除はIndexの大きい方から
      repeat with itemIntNo from (numCntTagArray - 1) to 0 by -1
(ocidTagArray's removeObjectAtIndex:(itemIntNo))
      end repeat
      ##removeAllObjectsでも良かった
      #ocidTagArray's removeAllObjects()
      # repeat with itemTag in ocidTagArray
      #タグを削除して
      # (ocidTagArray's removeObject:(itemTag))
      #削除したタグArrayを戻す
      # end repeat
      #空のARRAYをセット
      set listDone to (itemFilePathURL's setResourceValue:(ocidTagArray) forKey:(refMe's NSURLTagNamesKey) |error|:(reference))
      if (item 1 of listDone) = true then
log "タグを削除しました"
      else
log itemFilePathURL's |path| as text
log "タグの削除に失敗しました"
      end if
    end if
    
    
    ##########
    set listResult to (itemFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLLabelNumberKey) |error|:(reference))
    set ocidGetLabelNo to (item 2 of listResult)
    set ocidSetLabelNo to (refMe's NSNumber's numberWithInt:(0))
    if ocidGetLabelNo ≠ ocidSetLabelNo then
      set listDone to (itemFilePathURL's setResourceValue:(ocidSetLabelNo) forKey:(refMe's NSURLLabelNumberKey) |error|:(reference))
      if (item 1 of listDone) = true then
log "ラベルを0に設定しました"
      else
        # log itemFilePathURL's |path| as text
        # log "ラベルの削除に失敗しました"
      end if
    else
      # log "ラベルは0が絶定されていました"
    end if
  end repeat
  
end open

|

ラベル と タグ

202402200625551696x990

【A】ラベル
【B】タグ
【C】Label番号
【D】Spotlight検索ビュー
【E】Finderサイドバー
【F】保存済みの検索条件



【A】ラベル
ラベルは基本的には1ファイル1つ設定される
ラベルが複数設定の場合は、内容的には ラベル+複数指定ラベルタグになる
[Label]FInderラベルの色番号を取得する
https://quicktimer.cocolog-nifty.com/icefloe/2024/01/post-0329e2.html
[Label]FInderラベルの色番号を設定する
https://quicktimer.cocolog-nifty.com/icefloe/2024/01/post-ff0c42.html
[Label]FInderラベルの色番号を削除=0をセットする
https://quicktimer.cocolog-nifty.com/icefloe/2024/01/post-5311a4.html
[bash]FInderラベルの色番号を取得する
https://quicktimer.cocolog-nifty.com/icefloe/2024/01/post-361e8f.html


【A-1】ラベルなし
【A-2】ラベル単色
【A-3】ラベル複数色


【A-1】ラベルなし
[Label]FInderラベルの色番号を削除=0をセットする
https://quicktimer.cocolog-nifty.com/icefloe/2024/01/post-5311a4.html

2596759092ea2ef1b9b4a43b59400f0f08b36b44
【A-2】ラベル単色
[Label]FInderラベルの色番号を設定する
https://quicktimer.cocolog-nifty.com/icefloe/2024/01/post-ff0c42.html
259676018e95ff77bc54748809ade0ee7a493efa
【A-3】ラベル複数色
ラベル複数色=ラベル単色+色ラベルタグ×複数=複数色指定のラベルはタグになる
ラベル複数色を設定する
https://quicktimer.cocolog-nifty.com/icefloe/2023/11/post-c3386f.html
[xattr]コマンドラインからFinerラベルを設定する
https://quicktimer.cocolog-nifty.com/icefloe/2023/10/post-3f7802.html
2596760740dfab8339f9c4ccf80728972cdbc56f



【B】タグ

[xattr]コマンドラインからFinerラベルを設定する
https://quicktimer.cocolog-nifty.com/icefloe/2023/10/post-3f7802.html



【B-1】タグ無し
【B-2】色ラベル無しタグ
【B-3】色ラベル有りタグ
【B-4】複数色ラベルタグ(ラベルのA-3ラベル複数色と同じ)
【macOS14】com.apple.LSSharedFileList.ProjectsItemsはsfl2からsfl3へ
圧縮 アーカイブは
NSKeyedArchiver
https://quicktimer.cocolog-nifty.com/icefloe/cat76056161/index.html
解凍 アン・アーカイブは
NSKeyedUnarchiver
https://quicktimer.cocolog-nifty.com/icefloe/cat76055043/index.html

参照してください


【B-1】タグ無し
[NSURLTagNamesKey]タグ削除
https://quicktimer.cocolog-nifty.com/icefloe/2023/11/post-4d8962.html
2596759092ea2ef1b9b4a43b59400f0f08b36b44
【B-2】色ラベル無しタグ
ラベル色無しのタグを設定する
https://quicktimer.cocolog-nifty.com/icefloe/2023/10/post-bb420b.html
25967658956a3651a800c4a158b91a603d329489
【B-3】色ラベル有りタグ

2596766509ba1c62a271c40678356cbddfa74111
【B-4】複数色ラベルタグ(ラベルのA-3ラベル複数色と同じ)
タグのみ設定する
https://quicktimer.cocolog-nifty.com/icefloe/2023/11/post-83a80b.html
2596760740dfab8339f9c4ccf80728972cdbc56f



【C】Label番号の違い(FinderラベルとOCで逆順)
2593688877a853ca3d34c4a7f8f354355f11353e


【D】Spotlight検索ビュー
設定SlicesRootAttributes
[com.apple.finder] SlicesRootAttributes
https://quicktimer.cocolog-nifty.com/icefloe/2022/05/post-a415d7.html
[Mobileconfig]SlicesRootAttributes
https://quicktimer.cocolog-nifty.com/icefloe/2022/06/post-e92079.html
[com.apple.finder] SlicesRootAttributes その2
https://quicktimer.cocolog-nifty.com/icefloe/2023/12/post-bd77fe.html
【D-A】ラベル kMDItemFSLabel
【D-B】タグ kMDItemUserTags


【D-A】ラベル kMDItemFSLabel
Screen_1_20240119150001
【D-B】タグ kMDItemUserTags
261828515a9b26ec9c0b94a218744894c21a5df8


【F】保存済みの検索条件
【F-1】ラベル kMDItemFSLabel
【F-2】タグ kMDItemUserTags

|

より以前の記事一覧

その他のカテゴリー

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