Droplet

[ドロップレット]ファイルパスの取得 (少し改良;自分用)


AppleScript サンプルコード

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

AppleScript サンプルソース(参考)
行番号ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003#com.cocolog-nifty.quicktimer.icefloe
004(*
005スクリプトエディタ.appで開いて
006ファイル>>書き出し>>アプリケーション
007に書き出して利用してください
008
009ドロップしたファイルのパスを取得して
010メッセージ欄にUTIを表示します
011*)
012----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
013use AppleScript version "2.8"
014use framework "Foundation"
015use framework "AppKit"
016use framework "UniformTypeIdentifiers"
017use scripting additions
018
019property refMe : a reference to current application
020
021
022on run
023  ##ドロップレット専用です
024  open listAliasFilePath
025end run
026
027on open listAliasFilePath
028  ##オープン用のURLリスト
029  set ocidOpenURLsArray to (refMe's NSMutableArray's alloc()'s initWithCapacity:0)
030  ##ダイアログ用のテキスト
031  set ocidOutPutString to refMe's NSMutableString's alloc()'s init()
032  set ocidMesString to refMe's NSMutableString's alloc()'s init()
033  repeat with itemAliasFilePath in listAliasFilePath
034    ##パスとURL
035    set strFilePath to (POSIX path of itemAliasFilePath) as text
036    set ocidFilePathStr to (refMe's NSString's stringWithString:(strFilePath))
037    set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
038    set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:false)
039    #
040    set listResponse to (ocidFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLContentTypeKey) |error| :(reference))
041    set ocidUTType to (item 2 of listResponse)
042    set ocidFileUTI to ocidUTType's identifier()
043    (ocidMesString's appendString:(ocidFileUTI))
044    (ocidMesString's appendString:("\n"))
045    ##ダイアログ用のテキストに格納
046    (ocidOutPutString's appendString:(ocidFilePathStr))
047    (ocidOutPutString's appendString:("\n"))
048    ##オープン用のURLリストに格納
049    (ocidOpenURLsArray's addObject:(ocidFilePathURL))
050    
051  end repeat
052  set strOutPutString to ocidOutPutString as text
053  set strMesString to ocidMesString as text
054  ########################
055  ## ダイアログ
056  ########################
057  ##前面に
058  set strName to (name of current application) as text
059  if strName is "osascript" then
060    tell application "Finder" to activate
061  else
062    tell current application to activate
063  end if
064  set aliasIconPath to (POSIX file "/System/Library/CoreServices/Finder.app/Contents/Resources/Finder.icns")
065  try
066    set recordResult to (display dialog strMesString with title "戻り値です" default answer strOutPutString buttons {"クリップボードにコピー", "終了", "Finderに表示"} default button "Finderに表示" cancel button "終了" giving up after 20 with icon aliasIconPath without hidden answer) as record
067  on error
068    return "エラーしました"
069  end try
070  if (gave up of recordResult) is true then
071    return "時間切れです"
072  end if
073  ##############################
074  #####Finderに表示
075  ##############################
076  if button returned of recordResult is "Finderに表示" then
077    set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace()
078    appSharedWorkspace's activateFileViewerSelectingURLs:(ocidOpenURLsArray)
079  end if
080  
081  ##############################
082  #####値のコピー
083  ##############################
084  if button returned of recordResult is "クリップボードにコピー" then
085    try
086      set strText to text returned of recordResult as text
087      ####ペーストボード宣言
088      set appPasteboard to refMe's NSPasteboard's generalPasteboard()
089      set ocidText to (refMe's NSString's stringWithString:(strText))
090      appPasteboard's clearContents()
091      appPasteboard's setString:(ocidText) forType:(refMe's NSPasteboardTypeString)
092    on error
093      tell application "Finder"
094        set the clipboard to strText as text
095      end tell
096    end try
097  end if
098end open
AppleScriptで生成しました

|

画像が入ったフォルダをプレビューで開く(1000ファイル超える場合は1000ファイル目まで読み込む)


AppleScript サンプルコード

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

AppleScript サンプルソース(参考)
行番号ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003#
004# com.cocolog-nifty.quicktimer.icefloe
005----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
006use AppleScript version "2.8"
007use framework "Foundation"
008use framework "AppKit"
009use framework "UniformTypeIdentifiers"
010use scripting additions
011
012property refMe : a reference to current application
013property strBundleID : "com.apple.Preview"
014
015###Wクリックで起動した場合
016on run
017  set strName to (name of current application) as text
018  if strName is "osascript" then
019    tell application "Finder" to activate
020  else
021    tell current application to activate
022  end if
023  
024  set aliasDefaultLocation to (path to desktop from user domain) as alias
025  set strPromptText to "画像が入ったフォルダをえらんでください"
026  set strMesText to "画像が入ったフォルダをえらんでください"
027  try
028    set listFolderPath to (choose folder strMesText with prompt strPromptText default location aliasDefaultLocation with multiple selections allowed, invisibles and showing package contents) as list
029  on error
030    log "エラーしました"
031    return "エラーしました"
032  end try
033  open listFolderPath
034end run
035
036###ドロップで起動した場合
037on open listFolderPath
038  ####################################
039  set appFileManager to refMe's NSFileManager's defaultManager()
040  ####プレビューを一度終了させてから処理させる
041  tell application id strBundleID to activate
042  repeat 3 times
043    try
044      delay 0.2
045      tell application id strBundleID to close every window
046    on error
047      tell application id strBundleID to close every document saving no
048      tell application id strBundleID to quit
049    end try
050    delay 0.2
051  end repeat
052  tell application id strBundleID to quit
053  ####プレビューの半ゾンビ化対策
054  set ocidRunningApplication to refMe's NSRunningApplication
055  set ocidAppArray to ocidRunningApplication's runningApplicationsWithBundleIdentifier:(strBundleID)
056  repeat with itemAppArray in ocidAppArray
057    delay 0.2
058    itemAppArray's terminate()
059  end repeat
060  
061  
062  
063  ####################################
064  ####フォルタ以外は処理しない
065  repeat with itemFolderPath in listFolderPath
066    set aliasFolderPath to itemFolderPath as alias
067    set strFilePath to (POSIX path of aliasFolderPath) as text
068    set ocidFilePathStr to (refMe's NSString's stringWithString:(strFilePath))
069    set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
070    set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath))
071    set listBoole to (ocidFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLIsDirectoryKey) |error| :(reference))
072    set boolIsDir to (item 2 of listBoole) as boolean
073    if boolIsDir is true then
074      log "フォルダなので処理開始"
075    else
076      set strName to (name of current application) as text
077      if strName is "osascript" then
078        tell application "Finder" to activate
079      else
080        tell current application to activate
081      end if
082      display alert "フォルダ以外は処理しないで終了します" giving up after 2
083      return ""
084    end if
085  end repeat
086  
087  ################################
088  ##テンポラリーをゴミ箱に
089  ################################  
090  
091  (*
092  ###ファイルマネジャー初期化
093  set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSLibraryDirectory) inDomains:(refMe's NSUserDomainMask))
094  set ocidLibraryDirPathURL to ocidURLsArray's firstObject()
095  set ocidTmpDirPathURL to ocidLibraryDirPathURL's URLByAppendingPathComponent:("Containers/com.apple.Preview/Data/tmp")
096  set listResult to (appFileManager's trashItemAtURL:(ocidTmpDirPathURL) resultingItemURL:(ocidTmpDirPathURL) |error| :(reference))
097  ##
098  set ocidAttrDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
099  # 777-->511 755-->493 700-->448 766-->502
100  ocidAttrDict's setValue:(511) forKey:(refMe's NSFilePosixPermissions)
101  set listBoolMakeDir to appFileManager's createDirectoryAtURL:(ocidTmpDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error| :(reference)
102  *)
103  ################################
104  ##【本処理】フォルダの数だけ繰り返し
105  ################################
106  ###enumeratorAtURL用のBoolean用
107  set ocidFalse to (refMe's NSNumber's numberWithBool:false)
108  set ocidTrue to (refMe's NSNumber's numberWithBool:true)
109  
110  ###ファイルURLのみを格納するリスト
111  set ocidFilePathURLAllArray to (refMe's NSMutableArray's alloc()'s initWithCapacity:0)
112  ###まずは全部のURLをArrayに入れる
113  repeat with itemFolderPath in listFolderPath
114    ######パス フォルダのエイリアス
115    set aliasDirPath to itemFolderPath as alias
116    ###UNIXパスにして
117    set strDirPath to (POSIX path of aliasDirPath) as text
118    ###Stringsに
119    set ocidDirPathStr to (refMe's NSString's stringWithString:(strDirPath))
120    ###パス確定させて
121    set ocidDirPath to ocidDirPathStr's stringByStandardizingPath
122    ###NSURLに
123    set ocidDirPathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidDirPath) isDirectory:(true))
124    ##################################
125    ##プロパティ
126    set ocidPropertieKey to {refMe's NSURLPathKey, refMe's NSURLIsRegularFileKey, refMe's NSURLContentTypeKey}
127    ##オプション(隠しファイルは含まない)
128    set ocidOption to refMe's NSDirectoryEnumerationSkipsHiddenFiles
129    ####ディレクトリのコンテツを収集(最下層まで)
130    set ocidEmuDict to (appFileManager's enumeratorAtURL:(ocidDirPathURL) includingPropertiesForKeys:(ocidPropertieKey) options:(ocidOption) errorHandler:(reference))
131    ###戻り値をリストに格納
132    #set ocidEmuFileURLArray to ocidEmuDict's allObjects()
133    # (ocidFilePathURLAllArray's addObjectsFromArray:ocidEmuFileURLArray)
134    repeat
135      set ocidEnuURL to ocidEmuDict's nextObject()
136      if ocidEnuURL = (missing value) then
137        exit repeat
138      else
139        (ocidFilePathURLAllArray's addObject:ocidEnuURL)
140      end if
141    end repeat
142  end repeat
143  ################################################
144  ####ファイル数が1000を超える場合は1000までで処理する
145  ################################################
146  set ocidSortDescriptorArray to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
147  set ocidSortDescriptor to (refMe's NSSortDescriptor's sortDescriptorWithKey:"absoluteString" ascending:(true) selector:"localizedStandardCompare:")
148  ocidSortDescriptorArray's addObject:(ocidSortDescriptor)
149  ocidFilePathURLAllArray's sortUsingDescriptors:(ocidSortDescriptorArray)
150  set numCntArray to ocidFilePathURLAllArray's |count|()
151  if numCntArray > 1000 then
152    set strName to (name of current application) as text
153    if strName is "osascript" then
154      tell application "Finder" to activate
155    else
156      tell current application to activate
157    end if
158    display alert "ファイル数が1000以上なので最初から1000までで処理します" giving up after 2
159    set ocidRange to refMe's NSRange's NSMakeRange(0, 1000)
160    set ocidFilePathURLAllArray to ocidFilePathURLAllArray's subarrayWithRange:(ocidRange)
161  end if
162  
163  ################################
164  ####必要なファイルだけのArrayにする
165  ################################
166  set ocidFilePathURLArray to (refMe's NSMutableArray's alloc()'s initWithCapacity:0)
167  ####URLの数だけ繰り返し
168  repeat with itemFilePathURL in ocidFilePathURLAllArray
169    ###################不要なファイルをゴミ箱に入れちゃう
170    ####拡張子取って
171    set ocidExtension to itemFilePathURL's pathExtension()
172
173      ###非表示ファイルは収集していないが
174 if (ocidExtension as text) is ".DS_Store" then
175      set listResult to (appFileManager's trashItemAtURL:(itemFilePathURL) resultingItemURL:(missing value) |error| :(reference))
176    else
177      ####URLをforKeyで取り出し
178      set listResult to (itemFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLIsRegularFileKey) |error| :(reference))
179      ###リストからNSURLIsRegularFileKeyのBOOLを取り出し
180      set boolIsRegularFileKey to item 2 of listResult
181      ####ファイルのみを(ディレクトリやリンボリックリンクは含まない)
182      if boolIsRegularFileKey is ocidTrue then
183        ####リストにする
184        (ocidFilePathURLArray's addObject:(itemFilePathURL))
185      end if
186    end if
187  end repeat
188  ##  log ocidFilePathURLArray as list
189  ################################
190  ####ファイルタイプのチェックをする
191  ################################
192  ###ファイルマネジャー初期化
193  set listUTI to doGetUTI() as list
194  ###ファイルURLのみを格納するリスト
195  set ocidFilePathURLArrayM to (refMe's NSMutableArray's alloc()'s initWithCapacity:0)
196  repeat with itemFilePathURL in ocidFilePathURLArray
197    ####UTIの取得
198    set listResourceValue to (itemFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLContentTypeKey) |error| :(reference))
199    set ocidContentType to (item 2 of listResourceValue)
200    set strUTI to (ocidContentType's identifier) as text
201    if listUTI contains strUTI then
202      (ocidFilePathURLArrayM's addObject:(itemFilePathURL))
203    end if
204  end repeat
205  
206  log ocidFilePathURLArrayM's firstObject()'s absoluteString as text
207  
208  ##  log ocidFilePathURLArrayM as list
209  ##############################
210  ####並び替え並び替え compare
211  ##############################
212  (*
213  compare:
214  caseInsensitiveCompare:
215  localizedCompare:
216  localizedStandardCompare:
217  localizedCaseInsensitiveCompare:
218  *)
219  
220  set ocidSortDescriptorArray to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
221  set ocidSortDescriptor to (refMe's NSSortDescriptor's sortDescriptorWithKey:"path" ascending:(true) selector:"localizedStandardCompare:")
222  #ocidSortDescriptorArray's addObject:(ocidSortDescriptor)
223  # set ocidSortDescriptor to (refMe's NSSortDescriptor's sortDescriptorWithKey:"absoluteString" ascending:(true) selector:"compare:")
224  ocidSortDescriptorArray's addObject:(ocidSortDescriptor)
225  ocidFilePathURLArrayM's sortUsingDescriptors:(ocidSortDescriptorArray)
226  log ocidFilePathURLArrayM's firstObject()'s absoluteString as text
227  
228  ##############################
229  ####エリアスリストにして
230  ##############################
231  ###ファイルマネジャー初期化
232  ###空のリスト=プレヴューに渡すため
233  set listAliasPath to {} as list
234  ###並び変わったファイルパスを順番に
235  repeat with itemFilePathURL in ocidFilePathURLArrayM
236    ###エイリアスにして
237    set aliasFilePath to (itemFilePathURL's absoluteURL()) as alias
238    ####リストに格納していく
239    set end of listAliasPath to aliasFilePath
240  end repeat
241  if listAliasPath is {} then
242    return "Openできる書類はありませんでした"
243  end if
244  ##############################
245  ####起動
246  ##############################
247  try
248    tell application id "com.apple.Preview" to launch
249  on error
250    tell application id "com.apple.Preview" to activate
251  end try
252  ##############################
253  ####プレビューで開く
254  ##############################
255  tell application id "com.apple.Preview"
256    activate
257    set numWindow to count of window
258    if numWindow = 0 then
259      try
260        open listAliasPath
261      on error
262        log "ここでエラー"
263      end try
264    else
265      ####新しいウィンドで開く方法がわからん
266      ####新しいインスタンス生成すれば良いのかな
267      open listAliasPath
268    end if
269  end tell
270  
271end open
272
273
274
275
276
277to doGetUTI()
278  ###ファイルマネジャー初期化
279  set appFileManager to refMe's NSFileManager's defaultManager()
280  ###アプリケーションのURLを取得
281  ###NSバンドルをUTIから取得
282  set ocidAppBundle to refMe's NSBundle's bundleWithIdentifier:(strBundleID)
283  if ocidAppBundle = (missing value) then
284    ###NSバンドル取得できなかった場合
285    set appNSWorkspace to refMe's NSWorkspace's sharedWorkspace()
286    set ocidAppPathURL to appNSWorkspace's URLForApplicationWithBundleIdentifier:(strBundleID)
287  else
288    set ocidAppPathURL to ocidAppBundle's bundleURL()
289  end if
290  ###Plistのパス
291  set ocidPlistPathURL to ocidAppPathURL's URLByAppendingPathComponent:("Contents/Info.plist") isDirectory:false
292  set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithContentsOfURL:(ocidPlistPathURL)
293  set ocidDocTypeArray to ocidPlistDict's objectForKey:"CFBundleDocumentTypes"
294  if ocidDocTypeArray = (missing value) then
295    set strOutPutText to "missing value" as text
296  else
297    ####リストにする
298    set listUTl to {} as list
299    ###対応ドキュメントタイプをリストにしていく
300    repeat with itemDocTypeArray in ocidDocTypeArray
301      set listContentTypes to (itemDocTypeArray's objectForKey:"LSItemContentTypes")
302      if listContentTypes = (missing value) then
303        ###拡張子の指定のみの場合
304        set ocidExtension to (itemDocTypeArray's objectForKey:"CFBundleTypeExtensions")
305        set strClassName to ocidExtension's className() as text
306        repeat with itemExtension in ocidExtension
307          set strExtension to itemExtension as text
308          set ocidContentTypes to (refMe's UTType's typeWithFilenameExtension:(strExtension))
309          set strContentTypes to ocidContentTypes's identifier() as text
310          set strContentTypes to ("" & strContentTypes & "") as text
311          set end of listUTl to (strContentTypes)
312        end repeat
313      else
314        repeat with itemContentTypes in listContentTypes
315          set strContentTypes to ("" & itemContentTypes & "") as text
316          set end of listUTl to (strContentTypes)
317        end repeat
318      end if
319    end repeat
320  end if
321  return listUTl
322end doGetUTI
AppleScriptで生成しました

|

フォルダドロップレット汎用 考え中


AppleScript サンプルコード

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

AppleScript サンプルソース(参考)
行番号ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003#
004#
005#
006# com.cocolog-nifty.quicktimer.icefloe
007----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
008use AppleScript version "2.8"
009use framework "Foundation"
010use framework "AppKit"
011use scripting additions
012property refMe : a reference to current application
013
014#################################
015#【設定項目】
016#ここで指定するUTIは親要素が望ましい
017property strUTI : ("public.folder") as text
018
019
020#################################
021#【1】クリックでオープンした場合
022on run
023  #ダイアログ を前面に
024  set strName to (name of current application) as text
025  if strName is "osascript" then
026    tell application "Finder" to activate
027  else
028    tell current application to activate
029  end if
030  #デフォルトパス
031  set appFileManager to refMe's NSFileManager's defaultManager()
032  set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
033  set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
034  set aliasDefaultLocation to (ocidDesktopDirPathURL's absoluteURL()) as alias
035  set strMes to ("フォルダを選んでください") as text
036  set strPrompt to ("フォルダを選んでください") as text
037  try
038    #ダイアログ
039    set listChooseAliasDirPath to (choose folder strMes with prompt strPrompt default location (aliasDefaultLocation) with multiple selections allowed without invisibles and showing package contents) as list
040  on error
041    log "エラーしました"
042    return "エラーしました"
043  end try
044  #ファイルリストを次の処理に渡す
045  set boolDone to doPathSender(listChooseAliasDirPath)
046  #戻り値チェック
047  if boolDone is false then
048    display alert "エラーが発生しました" message "エラーが発生しました"
049    return "エラー終了run"
050  else
051    return "処理終了run"
052  end if
053end run
054
055#################################
056#【2】ドロップした場合
057on open listDropAliasDirPath
058  #########【2−1】UTIチェック
059  #親要素(この属性なら処理する)のUTType
060  set ocidChkUTType to refMe's UTType's typeWithIdentifier:(strUTI)
061  #サブルーチンに渡すリスト
062  set listAliasDirPath to {} as list
063  #ドロップされたアイテムの数だけ繰り返す
064  repeat with itemDropAliasDirPath in listDropAliasDirPath
065    #エイリアス
066    set aliasItemDirPath to itemDropAliasDirPath as alias
067    set strName to (name of current application) as text
068    if strName is "osascript" then
069      tell application "Finder"
070        #Finder情報を取得して
071        set recordInfoFor to info for aliasItemDirPath
072      end tell
073    else
074      tell current application
075        set recordInfoFor to info for aliasItemDirPath
076      end tell
077    end if
078    #フォルダか?確認
079    set boolFolder to (folder of recordInfoFor) as boolean
080    if boolFolder is true then
081      log "フォルダなので処理対象"
082      set beginning of listAliasDirPath to aliasItemDirPath
083    else if boolFolder is false then
084      log "フォルダではないので処理しない"
085    end if
086  end repeat
087  #本来不要だけど ハードリンク対策で入れてある
088  #########【2−1】KINDチェック
089  set listSendAliasDirPath to {} as list
090  repeat with itemAliasDirPath in listAliasDirPath
091    set aliasDirPath to itemAliasDirPath as alias
092    #処理する判定
093    set boolChkAliasPath to true as boolean
094    try
095      tell application "Finder"
096        set strKind to (kind of aliasDirPath) as text
097      end tell
098      if strKind is "アプリケーション" then
099        log "アプリケーションは処理しない"
100        set boolChkAliasPath to false as boolean
101      else if strKind is "ボリューム" then
102        log "ボリュームは処理しない"
103        set boolChkAliasPath to false as boolean
104      else if strKind is "エイリアス" then
105        log "エイリアスは処理しない"
106        set boolChkAliasPath to false as boolean
107      end if
108    on error
109      log "シンボリックリンク等kindを取得できないファイルは処理しない"
110      set boolChkAliasPath to false as boolean
111    end try
112    if boolChkAliasPath is true then
113      set beginning of listSendAliasDirPath to aliasDirPath
114    end if
115  end repeat
116  
117  #########【2−3】次工程に渡す
118  set boolDone to doPathSender(listSendAliasDirPath)
119  if boolDone is not true then
120    return false
121  else
122    return "処理終了open"
123  end if
124end open
125
126#################################
127#【3】1と2から
128#フォルダパスのエイリアスリストを受け取り
129#処理に順番に渡す
130to doPathSender(argListAliasDirPath)
131  set appFileManager to refMe's NSFileManager's defaultManager()
132  #1回でいい処理はここに記述する
133  
134  ####1フォルダパス毎本処理に渡す
135  repeat with itemAliasDirPath in argListAliasDirPath
136    #■本処理に渡す
137    set boolDone to doAction(itemAliasDirPath)
138    #戻り値がエラーだったら?
139    if boolDone is false then
140      tell application "Finder"
141        set strDirName to (name of itemAliasDirPath) as text
142      end tell
143      set strMes to (strDirName & "でエラーになりました") as text
144      display alert "エラーが発生しました" message strMes
145      return strMes
146      #エラーになったところで止める
147    end if
148  end repeat
149  return true
150end doPathSender
151
152#################################
153#【4】実際の処理は全てここ
154to doAction(argAliasDirPath)
155  set appFileManager to refMe's NSFileManager's defaultManager()
156  set aliasDirPath to argAliasDirPath as alias
157  set strDirPath to (POSIX path of aliasDirPath) as text
158  set ocidDirPathStr to refMe's NSString's stringWithString:(strDirPath)
159  set ocidDirPath to ocidDirPathStr's stringByStandardizingPath()
160  set ocidDirPathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidDirPath) isDirectory:(true))
161  ###
162  try
163    ######ここに本処理を入れる
164    log strDirPath
165  on error
166    #エラーになったらfalseを戻す
167    return false
168  end try
169  
170  return true
171end doAction
AppleScriptで生成しました

|

ドロップレット基本フォーマット


AppleScript サンプルコード

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

AppleScript サンプルソース(参考)
行番号ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003#
004#
005#
006# com.cocolog-nifty.quicktimer.icefloe
007----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
008use AppleScript version "2.6"
009use framework "Foundation"
010use framework "AppKit"
011use scripting additions
012
013property refMe : a reference to current application
014#ここで指定するUTIは親要素が望ましい
015property strUTI : "public.image" as text
016
017
018#################################
019#【1】クリックでオープンした場合
020on run
021  #ダイアログ を前面に
022  set strName to (name of current application) as text
023  if strName is "osascript" then
024    tell application "Finder" to activate
025  else
026    tell current application to activate
027  end if
028  #デフォルトパス
029  set appFileManager to refMe's NSFileManager's defaultManager()
030  set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
031  set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
032  set aliasDefaultLocation to (ocidDesktopDirPathURL's absoluteURL()) as alias
033  set strMes to ("画像ファイルを選んでください") as text
034  set strPrompt to ("画像ファイルを選んでください") as text
035  try
036    #ダイアログ
037    set listChooseAliasFilePath to (choose file strMes with prompt strPrompt default location (aliasDefaultLocation) of type listUTI with multiple selections allowed without invisibles and showing package contents) as list
038  on error
039    log "エラーしました"
040    return "エラーしました"
041  end try
042  #ファイルリストを次の処理に渡す
043  set boolDone to doPathSender(listChooseAliasFilePath)
044  #戻り値チェック
045  if boolDone is false then
046    display alert "エラーが発生しました" message "エラーが発生しました"
047    return "エラー終了run"
048  else
049    return "処理終了run"
050  end if
051end run
052
053#################################
054#【2】ドロップした場合
055on open listDropAliasFilePath
056  #########【2−1】UTIチェック
057  #親要素(この属性なら処理する)のUTType
058  set ocidChkUTType to refMe's UTType's typeWithIdentifier:(strUTI)
059  #サブルーチンに渡すリスト
060  set listAliasFilePath to {} as list
061  #ドロップされたアイテムの数だけ繰り返す
062  repeat with itemDropAliasFilePath in listDropAliasFilePath
063    #エイリアス
064    set aliasItemFilePath to itemDropAliasFilePath as alias
065    set strName to (name of current application) as text
066    if strName is "osascript" then
067      tell application "Finder"
068        #Finder情報を取得して
069        set recordInfoFor to info for aliasItemFilePath
070      end tell
071    else
072      tell current application
073        set recordInfoFor to info for aliasItemFilePath
074      end tell
075    end if
076    #UTIを取得
077    set strItemUIT to (type identifier of recordInfoFor) as text
078    set ocidUTType to (refMe's UTType's typeWithIdentifier:(strItemUIT))
079    set ocidParentUTIArray to (ocidUTType's supertypes())'s allObjects()
080    #含まれているか?チェックする
081    set boolContain to (ocidParentUTIArray's containsObject:(ocidChkUTType))
082    if boolContain is true then
083      log "含まれているので処理対象"
084      copy aliasItemFilePath to end of listAliasFilePath
085    else if boolContain is false then
086      log "含まれてない"
087    end if
088  end repeat
089  #本来不要だけど ハードリンク対策で入れてある
090  #########【2−1】KINDチェック
091  set listSendAliasFilePath to {} as list
092  repeat with itemAliasFilePath in listAliasFilePath
093    set aliasFilePath to itemAliasFilePath as alias
094    #処理する判定
095    set boolChkAliasPath to true as boolean
096    try
097      tell application "Finder"
098        set strKind to (kind of aliasFilePath) as text
099      end tell
100      if strKind is "アプリケーション" then
101        log "アプリケーションは処理しない"
102        set boolChkAliasPath to false as boolean
103      else if strKind is "ボリューム" then
104        log "ボリュームは処理しない"
105        set boolChkAliasPath to false as boolean
106      else if strKind is "エイリアス" then
107        log "エイリアスは処理しない"
108        set boolChkAliasPath to false as boolean
109      else if strKind is "フォルダ" then
110        log "フォルダは処理しない"
111        set boolChkAliasPath to false as boolean
112      end if
113    on error
114      log "シンボリックリンク等kindを取得できないファイルは処理しない"
115      set boolChkAliasPath to false as boolean
116    end try
117    if boolChkAliasPath is true then
118      copy aliasFilePath to end of listSendAliasFilePath
119    end if
120  end repeat
121  
122  #########【2−3】次工程に渡す
123  set boolDone to doPathSender(listSendAliasFilePath)
124  if boolDone is not true then
125    return false
126  else
127    return "処理終了open"
128  end if
129end open
130
131#################################
132#【3】1と2からファイルパスのエイリアスを受け取り
133#処理に順番に渡す
134to doPathSender(argListAliasFilePath)
135  set appFileManager to refMe's NSFileManager's defaultManager()
136  #1回でいい処理はここに記述する
137  
138  ####1ファイルパス毎本処理に渡す
139  repeat with itemAliasFilePath in argListAliasFilePath
140    #■本処理に渡す
141    set boolDone to doAction(itemAliasFilePath)
142    #戻り値がエラーだったら?
143    if boolDone is false then
144      tell application "Finder"
145        set strFileName to (name of itemAliasFilePath) as text
146      end tell
147      set strMes to (strFileName & "でエラーになりました") as text
148      display alert "エラーが発生しました" message strMes
149      return strMes
150      #エラーになったところで止める
151    end if
152  end repeat
153  return true
154end doPathSender
155
156#################################
157#【4】実際の処理は全てここ
158to doAction(argAliasFilePath)
159  set appFileManager to refMe's NSFileManager's defaultManager()
160  set aliasFilePath to argAliasFilePath as alias
161  set strFilePath to (POSIX path of aliasFilePath) as text
162  set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
163  set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
164  set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:(false))
165  
166  ###
167  try
168    log strFilePath
169  on error
170    #エラーになったらfalseを戻す
171    return false
172  end try
173  
174  return true
175end doAction
AppleScriptで生成しました

|

ドロップレット基本フォーマット(再考中)


AppleScript サンプルコード

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

AppleScript サンプルソース(参考)
行番号ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003#
004#
005# com.cocolog-nifty.quicktimer.icefloe
006----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
007use AppleScript version "2.6"
008use framework "Foundation"
009use framework "AppKit"
010use scripting additions
011
012property refMe : a reference to current application
013# property listUTI : {"public.image"} as list
014property listUTI : {"public.item"} as list
015
016#################################
017#【1】クリックでオープンした場合
018on run
019  #ダイアログ を前面に
020  set strName to (name of current application) as text
021  if strName is "osascript" then
022    tell application "Finder" to activate
023  else
024    tell current application to activate
025  end if
026  #デフォルトパス
027  set appFileManager to refMe's NSFileManager's defaultManager()
028  set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
029  set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
030  set aliasDefaultLocation to (ocidDesktopDirPathURL's absoluteURL()) as alias
031  set strMes to ("ファイルを選んでください") as text
032  set strPrompt to ("ファイルを選んでください") as text
033  try
034    #ダイアログ
035    set listChooseAliasFilePath to (choose file strMes with prompt strPrompt default location (aliasDefaultLocation) of type listUTI with multiple selections allowed without invisibles and showing package contents) as list
036  on error
037    log "エラーしました"
038    return "エラーしました"
039  end try
040  #ファイルリストを次の処理に渡す
041  set boolDone to doPathSender(listChooseAliasFilePath)
042  #戻り値チェック
043  if boolDone is false then
044    display alert "エラーが発生しました" message "エラーが発生しました"
045    return "エラー終了run"
046  else
047    return "処理終了run"
048  end if
049end run
050
051#################################
052#【2】ドロップした場合
053on open listDropAliasFilePath
054  #########【2−1】UTIチェック
055  #サブルーチンに渡すリスト
056  set listAliasFilePath to {} as list
057  #ドロップされたアイテムの数だけ繰り返す
058  repeat with itemDropAliasFilePath in listDropAliasFilePath
059    #エイリアス
060    set aliasItemFilePath to itemDropAliasFilePath as alias
061    tell application "Finder"
062      #Finder情報を取得して
063      set recordInfoFor to info for aliasItemFilePath
064    end tell
065    #UTIを取得
066    set strItemUIT to (type identifier of recordInfoFor) as text
067    #UTIが対象ファイルならリストに追加
068    repeat with itemUTI in listUTI
069      if strItemUIT is itemUTI then
070        copy aliasItemFilePath to end of listAliasFilePath
071      end if
072    end repeat
073  end repeat
074  #########【2−1】KINDチェック
075  set listSendAliasFilePath to {} as list
076  repeat with itemAliasFilePath in listAliasFilePath
077    #処理する判定
078    set boolChkAliasPath to true as boolean
079    try
080      tell application "Finder"
081        set strKind to (kind of itemDropObject) as text
082      end tell
083      if strKind is "アプリケーション" then
084        log "アプリケーションは処理しない"
085        set boolChkAliasPath to false as boolean
086      else if strKind is "ボリューム" then
087        log "ボリュームは処理しない"
088        set boolChkAliasPath to false as boolean
089      else if strKind is "エイリアス" then
090        log "エイリアスは処理しない"
091        set boolChkAliasPath to false as boolean
092      else if strKind is "フォルダ" then
093        log "フォルダは処理しない"
094        set boolChkAliasPath to false as boolean
095      end if
096    on error
097      log "シンボリックリンク等kindを取得できないファイルは処理しない"
098      set boolChkAliasPath to false as boolean
099    end try
100    if boolChkAliasPath is true then
101      copy itemAliasFilePath to end of listSendAliasFilePath
102    end if
103  end repeat
104  #########【2−3】次工程に渡す
105  set boolDone to doPathSender(listSendAliasFilePath)
106  if boolDone is not true then
107    return false
108  else
109    return "処理終了open"
110  end if
111end open
112
113#################################
114#【3】1と2からファイルパスのエイリアスを受け取り
115#処理に順番に渡す
116to doPathSender(argListAliasFilePath)
117  set appFileManager to refMe's NSFileManager's defaultManager()
118  #1回でいい処理はここに記述する
119  
120  ####1ファイルパス毎本処理に渡す
121  repeat with itemAliasFilePath in argListAliasFilePath
122    #本処理に渡す
123    set boolDone to doAction(itemAliasFilePath)
124    #戻り値がエラーだったら?
125    if boolDone is false then
126      tell application "Finder"
127        set strFileName to (name of itemAliasFilePath) as text
128      end tell
129      set strMes to (strFileName & "でエラーになりました") as text
130      display alert "エラーが発生しました" message strMes
131      return strMes
132      #エラーになったところで止める
133    end if
134  end repeat
135  return true
136end doPathSender
137
138#################################
139#【4】実際の処理は全てここ
140to doAction(argAliasFilePath)
141  set appFileManager to refMe's NSFileManager's defaultManager()
142  set aliasFilePath to argAliasFilePath as alias
143  set strFilePath to (POSIX path of aliasFilePath) as text
144  set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
145  set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
146  set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:(false))
147  
148  ###
149  try
150    log strFilePath
151  on error
152    #エラーになったらfalseを戻す
153    return false
154  end try
155  
156  return true
157end doAction
AppleScriptで生成しました

|

[AppleScript]ドロップレット OPENしたくない(Openに値を渡さない & ログを出す)その3


AppleScript サンプルコード

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

AppleScript サンプルソース(参考)
行番号ソース
001#! /usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003# com.cocolog-nifty.quicktimer.icefloe
004#
005----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
006use AppleScript version "2.8"
007use framework "Foundation"
008use framework "AppKit"
009use scripting additions
010
011property refMe : a reference to current application
012###################
013#設定項目 対象のUTI
014property strUTI : ("com.adobe.pdf") as text
015
016###################
017#Wクリックで実行
018on run
019  ###ダイアログを前面に出す
020  tell current application
021    set strName to name as text
022  end tell
023  if strName is "osascript" then
024    tell application "Finder" to activate
025  else
026    tell current application to activate
027  end if
028  #ダイアログ
029  set appFileManager to refMe's NSFileManager's defaultManager()
030  set ocidUserDesktopPathArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
031  set ocidUserDesktopPath to ocidUserDesktopPathArray's objectAtIndex:0
032  set listChooseFileUTI to {strUTI} as list
033  set strMesText to ("PDFファイルを選んでください") as text
034  set strPromptText to ("PDFファイルを選んでください") as text
035  set listChooseAliasFilePath to (choose file strMesText with prompt strPromptText default location (ocidUserDesktopPath as alias) of type listChooseFileUTI with invisibles and multiple selections allowed without showing package contents) as list
036  #サブルーチンに渡す
037  set boolDone to doAction(listChooseAliasFilePath)
038  #戻り値がエラーだったか?
039  if boolDone is false then
040    display alert "エラーが発生しました" message "エラーが発生しました"
041    return
042  end if
043  return "処理終了RUN"
044end run
045
046###################
047#ドロップ
048on open listDropAliasFilePath
049  #サブルーチンに渡すリスト
050  set listAliasFilePath to {} as list
051  #ドロップされたアイテムの数だけ繰り返す
052  repeat with itemDropAliasFilePath in listDropAliasFilePath
053    #エイリアス
054    set aliasItemFilePath to itemDropAliasFilePath as alias
055    tell application "Finder"
056      #Finder情報を取得して
057      set recordInfoFor to info for aliasItemFilePath
058    end tell
059    #UTIを取得
060    set strItemUIT to (type identifier of recordInfoFor) as text
061    #UTIが対象ファイルならリストに追加
062    if strItemUIT is strUTI then
063      copy aliasItemFilePath to end of listAliasFilePath
064    end if
065  end repeat
066  set numCntAliasList to (count of listAliasFilePath) as integer
067  if numCntAliasList > 0 then
068    #サブルーチンに渡す
069    set boolDone to doAction(listAliasFilePath)
070  else
071    display alert "エラーが発生しました対象のファイルではありません"
072    return "エラー終了open"
073  end if
074  #戻り値がエラーだったか?
075  if boolDone is false then
076    display alert "エラーが発生しました" message "エラーが発生しました"
077    return "エラー終了open"
078  end if
079  return "処理終了open"
080  
081end open
082
083###################
084#実行されるのはこれ
085to doAction(argListAliasFilePath)
086  #ファイルエイリアスリストを順番の処理
087  repeat with itemAliasFilePath in argListAliasFilePath
088    set aliasFilePath to itemAliasFilePath as alias
089    try
090      #ここに処理内容
091      display alert "ドロップしたファイルのパス" & (POSIX path of aliasFilePath)
092    on error
093      #エラーをログにする
094      refMe's NSLog("■■■: サブルーチンでエラーになりました")
095      return false
096    end try
097  end repeat
098  #全部エラーなく終わったらtrueを戻す
099  return true
100end doAction
AppleScriptで生成しました

|

[AppleScript]ドロップレット OPENしたくない(Openに値を渡さない & ログを出す)その2


AppleScript サンプルコード

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

AppleScript サンプルソース(参考)
行番号ソース
001#! /usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003# com.cocolog-nifty.quicktimer.icefloe
004#
005----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
006use AppleScript version "2.8"
007use framework "Foundation"
008use scripting additions
009
010property refMe : a reference to current application
011
012###################
013#Wクリックで実行
014#エディタから実行
015on run
016  
017  set listAliasFilePath to (choose file with multiple selections allowed) as list
018  #サブルーチンに渡す
019  set boolDone to doAction(listAliasFilePath)
020  if boolDone is false then
021    display alert "エラーが発生しました" message "エラーが発生しました"
022    return
023  end if
024  return
025  
026end run
027
028###################
029#ドロップ
030on open listAliasFilePath
031  #サブルーチンに渡す
032  set boolDone to doAction(listAliasFilePath)
033  if boolDone is false then
034    display alert "エラーが発生しました" message "エラーが発生しました"
035    return
036  end if
037  return
038  
039end open
040
041###################
042#実行されるのはこれ
043to doAction(argListAliasFilePath)
044  #ファイルエイリアスリストを順番の処理
045  repeat with itemAliasFilePath in argListAliasFilePath
046    try
047      ##ここに本処理
048      set listButtons to {"OK", "QUIT"} as list
049      display alert "ドロップしたファイルのパス" message (itemAliasFilePath as text) buttons listButtons default button (item 1 of listButtons) cancel button (item 2 of listButtons) giving up after 3
050    on error
051      #エラーをログにする
052      refMe's NSLog("■■■: サブルーチンでエラーになりました")
053      return false
054    end try
055  end repeat
056  #全部エラーなく終わったらtrueを戻す
057  return true
058end doAction
AppleScriptで生成しました

|

[AppleScript]ドロップレットの場合のPath to me


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

[AppleScript]ドロップレットの場合のPath to me .scpt
ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003(*
004ドロップレットのPATH TO ME
005/some/dir/some.appまで
006書き出しからアプリケーションにして確認してください
007com.cocolog-nifty.quicktimer.icefloe *)
008----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
009on run
010   set aliasPathToMe to (path to me) as alias
011   set strPathToMe to (POSIX path of aliasPathToMe) as text
012   doAction(strPathToMe)
013end run
014on open
015   
016   set aliasPathToMe to (path to me) as alias
017   set strPathToMe to (POSIX path of aliasPathToMe) as text
018   doAction(strPathToMe)
019end open
020to doAction(argFilePath)
021   display alert argFilePath
022   
023   
024end doAction
AppleScriptで生成しました

サンプルコード

サンプルソース(参考)
行番号ソース
001on run
002  set aliasPathToMe to (path to me) as alias
003  set strPathToMe to (POSIX path of aliasPathToMe) as text
004
005   doAction(strPathToMe)
006end run
007
008
009on open
010  
011  set aliasPathToMe to (path to me) as alias
012  set strPathToMe to (POSIX path of aliasPathToMe) as text
013   doAction(strPathToMe)
014end open
015
016
017to doAction(argFilePath)
018    display alert argFilePath
019  
020  
021end doAction
AppleScriptで生成しました

|

[AppleScript]ドロップレット OPENしたくない(Openに値を渡さないようにしたい)


サンプルコード

サンプルソース(参考)
行番号ソース
001###################
002#Wクリックで実行
003#エディタから実行
004on run
005  set listAliasFilePath to (choose file with multiple selections allowed) as list
006  repeat with itemAliasFilePath in listAliasFilePath
007    doAction(itemAliasFilePath)
008  end repeat
009end run
010
011###################
012#ドロップ
013on open listAliasFilePath
014  repeat with itemAliasFilePath in listAliasFilePath
015    doAction(itemAliasFilePath)
016  end repeat
017end open
018
019###################
020#実行されるのはこれ
021to doAction(argListAliasFilePath)
022  display alert (argListAliasFilePath as text)
023  
024end doAction
AppleScriptで生成しました

|

その他のカテゴリー

Accessibility Acrobat Acrobat 2020 Acrobat 2024 Acrobat AddOn Acrobat Annotation Acrobat AppleScript Acrobat ARMDC Acrobat AV2 Acrobat BookMark Acrobat Classic Acrobat DC Acrobat Dialog Acrobat Distiller Acrobat Form Acrobat GentechAI Acrobat JS Acrobat JS Word Search Acrobat Maintenance Acrobat Manifest Acrobat Menu Acrobat Merge Acrobat Open Acrobat PDFPage Acrobat Plugin Acrobat Preferences Acrobat Preflight Acrobat Print Acrobat Python Acrobat Reader Acrobat Reader Localized Acrobat Reference Acrobat Registered Products Acrobat SCA Acrobat SCA Updater Acrobat Sequ Acrobat Sign Acrobat Stamps Acrobat URL List Mac Acrobat URL List Windows Acrobat Watermark Acrobat Windows Acrobat Windows Reader Admin Admin Account Admin Apachectl Admin ConfigCode Admin configCode Admin Device Management Admin LaunchServices Admin Locationd Admin loginitem Admin Maintenance Admin Mobileconfig Admin NetWork Admin Permission Admin Pkg Admin Power Management Admin Printer Admin Printer Basic Admin Printer Custompapers Admin SetUp Admin SMB Admin softwareupdate Admin Support Admin System Information Admin TCC Admin Tools Admin Umask Admin Users Admin Volumes Admin XProtect Adobe Adobe AUSST Adobe Bridge Adobe Documents Adobe FDKO Adobe Fonts Adobe Reference Adobe RemoteUpdateManager Adobe Sap Code AppKit Apple AppleScript AppleScript Duplicate AppleScript entire contents AppleScript List AppleScript ObjC AppleScript Osax AppleScript PDF AppleScript Pictures AppleScript record AppleScript Video Applications AppStore Archive Archive Keka Attributes Automator BackUp Barcode Barcode Decode Barcode QR Bash Basic Basic Path Bluetooth BOX Browser Calendar CD/DVD Choose Chrome Chromedriver CIImage CityCode CloudStorage Color Color NSColor Color NSColorList com.apple.LaunchServices.OpenWith Console Contacts CotEditor CURL current application Date&Time delimiters Desktop Desktop Position Device Diff Disk do shell script Dock Dock Launchpad DropBox Droplet eMail Encode % Encode Decode Encode HTML Entity Encode UTF8 Error EXIFData exiftool ffmpeg File File Name Finder Finder Window Firefox Folder FolderAction Font List FontCollections Fonts Fonts Asset_Font Fonts ATS Fonts Emoji Fonts Maintenance Fonts Morisawa Fonts Python Fonts Variable Foxit GIF github Guide HTML Icon Icon Assets.car Illustrator Image Events ImageOptim Input Dictionary iPhone iWork Javascript Jedit Ω Json Label Language Link locationd lsappinfo m3u8 Mail Map Math Media Media AVAsset Media AVconvert Media AVFoundation Media AVURLAsset Media Movie Media Music Memo Messages Microsoft Microsoft Edge Microsoft Excel Microsoft Fonts Microsoft Office Microsoft Office Link Microsoft OneDrive Microsoft Teams Mouse Music Node Notes NSArray NSArray Sort NSAttributedString NSBezierPath NSBitmapImageRep NSBundle NSCFBoolean NSCharacterSet NSData NSDecimalNumber NSDictionary NSError NSEvent NSFileAttributes NSFileManager NSFileManager enumeratorAtURL NSFont NSFontManager NSGraphicsContext NSGraphicsContext Crop NSImage NSIndex NSKeyedArchiver NSKeyedUnarchiver NSLocale NSMetadataItem NSMutableArray NSMutableDictionary NSMutableString NSNotFound NSNumber NSOpenPanel NSPasteboard NSpoint NSPredicate NSRange NSRect NSRegularExpression NSRunningApplication NSScreen NSSet NSSize NSString NSString stringByApplyingTransform NSStringCompareOptions NSTask NSTimeZone NSUbiquitous NSURL NSURL File NSURLBookmark NSURLComponents NSURLResourceKey NSURLSession NSUserDefaults NSUUID NSView NSWorkspace Numbers OAuth PDF PDF Image2PDF PDF MakePDF PDF nUP PDF Pymupdf PDF Pypdf PDFContext PDFDisplayBox PDFImageRep PDFKit PDFKit Annotation PDFKit AnnotationWidget PDFKit DocumentPermissions PDFKit OCR PDFKit Outline PDFKit Start PDFPage PDFPage Rotation PDFView perl Photoshop PlistBuddy pluginkit plutil postalcode PostScript PowerShell prefPane Preview Python Python eyed3 Python pip QuickLook QuickTime ReadMe Regular Expression Reminders ReName Repeat RTF Safari SaveFile ScreenCapture ScreenSaver Script Editor Script Menu SF Symbols character id SF Symbols Entity Shortcuts Shortcuts Events sips Skype Slack Sound Spotlight sqlite StandardAdditions StationSearch Subtitles LRC Subtitles SRT Subtitles VTT Swift swiftDialog System Events System Settings TemporaryItems Terminal Text Text CSV Text MD Text TSV TextEdit Tools Translate Trash Twitter Typography UI Unit Conversion UTType valueForKeyPath Video VisionKit Visual Studio Code VMware Fusion Wacom Weather webarchive webp Wifi Windows XML XML EPUB XML HTML XML LSSharedFileList XML LSSharedFileList sfl2 XML LSSharedFileList sfl3 XML objectsForXQuery XML OPML XML Plist XML Plist System Events XML RSS XML savedSearch XML SVG XML TTML XML webloc XML xmllint XML XMP YouTube Zero Padding zoom