NSURL File

[AppleScript・OBJC]ファイル名を取得する


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

【基本】ファイルパス【OBJC】.scpt
ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003(*
004ファイルパスからのファイル名の取得
005A: text】:pathUNIX形式のパス 実態参照しない posix path 形式
006B: alias】:alias:エイリアス形式のパス 実態参照するエイリアス形式
007C: furl】:frul:実態参照しないエイリアス形式
008【D: URL】:URLURL形式
009【E: specifier】:HFSFinder file形式
010
011#F:NSStringOBJC NSString=テキスト
012#G:NSPathStore2OBJC NSPathStore2=パス(テキスト)
013#H:NSURLOBJC NSURL
014
015基本は同じ
016UNIXパス形式に変換してからNSStringで取得するか?
017NSURLにしてから取得するか?
018そして
019ファイルパスの場合『は』lastPathComponentがファイル名
020
021注意が必要なのは1点
022UNIXパスで『~』が使われている場合
023NSStringでは意図した値にならない事があるので
024NSPathStore2に展開して絶対パスにする必要がある場合がある
025
026com.cocolog-nifty.quicktimer.icefloe *)
027----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
028##自分環境がos12なので2.8にしているだけです
029use AppleScript version "2.8"
030use framework "Foundation"
031use scripting additions
032property refMe : a reference to current application
033
034####################################
035set strFilePath to ("/Library/Documentation/Acknowledgements.rtf") as text
036
037#OBJC内でのパス形式
038#F:NSStringOBJC NSString=テキスト
039set ocidFilePathStr to current application's NSString's stringWithString:(strFilePath)
040
041#G:NSPathStore2OBJC NSPathStore2=パス(テキスト)
042set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
043
044#H:NSURLOBJC NSURL
045set ocidFilePathURL to current application's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:(false)
046
047####################################
048#AS内でのパスの入力形式
049#A: text】:pathUNIX形式のパス 実態参照しない posix path 形式
050set strFilePath to ("/Library/Documentation/Acknowledgements.rtf") as text
051
052#B: alias】:alias:エイリアス形式のパス 実態参照するエイリアス形式
053set aliasFilePath to ("Macintosh HD:Library:Documentation:Acknowledgements.rtf") as alias
054
055#C: furl】:frul:実態参照しないエイリアス形式
056set aliasFilePath to ("Macintosh HD:Library:Documentation:Acknowledgements.rtf") as «class furl»
057
058#【D: URL】:URLURL形式
059#このClassscripting additionsが必要になります
060set urlFilePath to ("file:///Library/Documentation/Acknowledgements.rtf") as URL
061
062#【E: specifier】:HFSFinder file形式
063tell application "Finder"
064   set fileFilePath to (file "Acknowledgements.rtf" of folder "Documentation" of folder "Library" of startup disk) as specifier
065end tell
066
067
068
069####################################
070#A: text】:pathUNIX形式のパス 実態参照しない posix path 形式
071set strFilePath to ("/Library/Documentation/Acknowledgements.rtf") as text
072
073#NSSTRING
074set ocidFilePathStr to current application's NSString's stringWithString:(strFilePath)
075set ocidFileName to ocidFilePathStr's lastPathComponent()
076log ocidFileName as text
077#NSPATHSTORE2
078set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
079set ocidFileName to ocidFilePath's lastPathComponent()
080log ocidFileName as text
081#NSURL
082set ocidFilePathURL to current application's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:(false)
083-->基本はこちらの記述
084set ocidFilePathURL to current application's NSURL's fileURLWithPath:(ocidFilePath)
085set ocidFileName to ocidFilePathURL's lastPathComponent()
086log ocidFileName as text
087
088
089
090####################################
091#B: alias】:alias:エイリアス形式のパス 実態参照するエイリアス形式
092set aliasFilePath to ("Macintosh HD:Library:Documentation:Acknowledgements.rtf") as alias
093
094set strFilePath to (POSIX path of aliasFilePath) as text
095#NSSTRING
096set ocidFilePathStr to current application's NSString's stringWithString:(strFilePath)
097set ocidFileName to ocidFilePathStr's lastPathComponent()
098log ocidFileName as text
099#NSPATHSTORE2
100set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
101set ocidFileName to ocidFilePath's lastPathComponent()
102log ocidFileName as text
103#NSURL
104set ocidFilePathURL to current application's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:(false)
105-->基本はこちらの記述
106set ocidFilePathURL to current application's NSURL's fileURLWithPath:(ocidFilePath)
107set ocidFileName to ocidFilePathURL's lastPathComponent()
108log ocidFileName as text
109
110####################################
111#C: furl】:frul:実態参照しないエイリアス形式
112set aliasFilePath to ("Macintosh HD:Library:Documentation:Acknowledgements.rtf") as «class furl»
113
114set strFilePath to (POSIX path of aliasFilePath) as text
115#NSSTRING
116set ocidFilePathStr to current application's NSString's stringWithString:(strFilePath)
117set ocidFileName to ocidFilePathStr's lastPathComponent()
118log ocidFileName as text
119#NSPATHSTORE2
120set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
121set ocidFileName to ocidFilePath's lastPathComponent()
122log ocidFileName as text
123#NSURL
124set ocidFilePathURL to current application's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:(false)
125-->基本はこちらの記述
126set ocidFilePathURL to current application's NSURL's fileURLWithPath:(ocidFilePath)
127set ocidFileName to ocidFilePathURL's lastPathComponent()
128log ocidFileName as text
129
130####################################
131#【D: URL】:URLURL形式 
132set urlFilePath to ("file:///Library/Documentation/Acknowledgements.rtf") as URL
133set strFilePathURL to (path of urlFilePath) as text
134
135set ocidFilePathURL to current application's NSURL's alloc()'s initWithString:(strFilePathURL)
136set ocidFileName to ocidFilePathURL's lastPathComponent()
137log ocidFileName as text
138-->基本はこちらの記述
139set ocidFilePathURL to current application's NSURL's URLWithString:(strFilePathURL)
140set ocidFileName to ocidFilePathURL's lastPathComponent()
141log ocidFileName as text
142
143####################################
144#【E: specifier】:HFSFinder file形式
145#Finder内ならaliasと同じ処理方法が可能です
146tell application "Finder"
147   set fileFilePath to (file "Acknowledgements.rtf" of folder "Documentation" of folder "Library" of startup disk) as specifier
148end tell
149set aliasFilePath to fileFilePath as alias
150set strFilePath to (POSIX path of aliasFilePath) as text
151#NSSTRING
152set ocidFilePathStr to current application's NSString's stringWithString:(strFilePath)
153set ocidFileName to ocidFilePathStr's lastPathComponent()
154log ocidFileName as text
155#NSPATHSTORE2
156set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
157set ocidFileName to ocidFilePath's lastPathComponent()
158log ocidFileName as text
159#NSURL
160set ocidFilePathURL to current application's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:(false)
161-->基本はこちらの記述
162set ocidFilePathURL to current application's NSURL's fileURLWithPath:(ocidFilePath)
163set ocidFileName to ocidFilePathURL's lastPathComponent()
164log ocidFileName as text
AppleScriptで生成しました

AppleScriptでのファイル名の取得

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

【基本】ファイルパス【B】.scpt
ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003(*
004ファイルパスからのファイル名の取得
005A: text】:pathUNIX形式のパス 実態参照しない posix path 形式
006B: alias】:alias:エイリアス形式のパス 実態参照するエイリアス形式
007C: furl】:frul:実態参照しないエイリアス形式
008【D: URL】:URLURL形式
009【E: specifier】:HFSFinder file形式
010
011com.cocolog-nifty.quicktimer.icefloe *)
012----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
013##自分環境がos12なので2.8にしているだけです
014use AppleScript version "2.8"
015use framework "Foundation"
016use scripting additions
017property refMe : a reference to current application
018
019
020#A: text】:pathUNIX形式のパス 実態参照しない posix path 形式
021set strFilePath to ("/Library/Documentation/Acknowledgements.rtf") as text
022
023#B: alias】:alias:エイリアス形式のパス 実態参照するエイリアス形式
024set aliasFilePath to ("Macintosh HD:Library:Documentation:Acknowledgements.rtf") as alias
025
026#C: furl】:frul:実態参照しないエイリアス形式
027set aliasFilePath to ("Macintosh HD:Library:Documentation:Acknowledgements.rtf") as «class furl»
028
029#【D: URL】:URLURL形式
030#このClassscripting additionsが必要になります
031set urlFilePath to ("file:///Library/Documentation/Acknowledgements.rtf") as URL
032
033#【E: specifier】:HFSFinder file形式
034tell application "Finder"
035   set fileFilePath to (file "Acknowledgements.rtf" of folder "Documentation" of folder "Library" of startup disk) as specifier
036end tell
037
038#F:NSStringOBJC NSString=テキスト
039#G:NSPathStore2OBJC NSPathStore2=パス(テキスト)
040#H:NSURLOBJC NSURL
041
042####################################
043#A: text】:pathUNIX形式のパス 実態参照しない posix path 形式
044#注意:pathの場合実態参照しないのでパスの先が存在しない可能性がある
045#そのため、処理に『よっては』エラーになるのを考慮する必要がある
046
047set strFilePath to ("/Library/Documentation/Acknowledgements.rtf") as text
048log class of strFilePath
049--> text
050log strFilePath
051
052#delimiters区切り文字でリスト化して最後の項目
053set strDelim to AppleScript's text item delimiters
054set AppleScript's text item delimiters to "/"
055set listFilePathComponent to every text item of strFilePath
056set AppleScript's text item delimiters to strDelim
057set strFileName to (last item of listFilePathComponent) as text
058log strFileName
059--> "Acknowledgements.rtf"
060
061
062#sh ファイル名の取得
063#パスの一部分として取り出す
064set strFileName to (do shell script "/usr/bin/basename \"" & strFilePath & "\"") as text
065log strFileName
066--> "Acknowledgements.rtf"
067
068#sh パスではなくテキストとしてみた場合
069#パラメータ展開を使ってスクリプト形式で処理する(邪道)
070set strFileName to (do shell script "PATH_INPUT=\"" & strFilePath & "\";STR_FILENAME=\"${PATH_INPUT##*/}\";echo \"$STR_FILENAME\"") as text
071log strFileName
072
073
074
075####################################
076#B: alias】:alias:エイリアス形式のパス 実態参照するエイリアス形式
077set aliasFilePath to ("Macintosh HD:Library:Documentation:Acknowledgements.rtf") as alias
078log class of aliasFilePath
079--> alias
080log aliasFilePath
081
082#scripting additionsinfo forを使う
083set recordInfo to (info for aliasFilePath) as record
084#ファイル名の取得
085set strFileName to (name of recordInfo) as text
086log strFileName
087--> "Acknowledgements.rtf"
088
089#Findernameを取得
090tell application "Finder"
091   set strFileName to (name of aliasFilePath) as text
092end tell
093log strFileName
094--> "Acknowledgements.rtf"
095
096#System Events  nameの取得
097tell application "System Events"
098   set strFileName to (name of aliasFilePath) as text
099end tell
100log strFileName
101--> "Acknowledgements.rtf"
102
103
104
105####################################
106#C: furl】:frul:実態参照しないエイリアス形式
107#注意:furlの場合実態参照しないのでパスの先が存在しない可能性がある
108#そのため、処理に『よっては』エラーになるのを考慮する必要がある
109#実態参照しないため、Finder等では、そのままではname=ファイル名が取得できない
110set aliasFilePath to ("Macintosh HD:Library:Documentation:Acknowledgements.rtf") as «class furl»
111log class of aliasFilePath
112--> «class furl»
113log aliasFilePath
114
115#scripting additionsinfo forを使う
116set recordInfo to (info for aliasFilePath) as record
117set strFileName to (name of recordInfo) as text
118log strFileName
119--> "Acknowledgements.rtf"
120
121#Findernameを取得
122tell application "Finder"
123   try
124      set strFileName to (name of aliasFilePath) as text
125      -->エラーになる
126   on error strErrMes number numErrNo
127      #エイリアス=実態参照させてからファイル名を取得する
128      set strFileName to (name of (aliasFilePath as alias)) as text
129   end try
130end tell
131log strFileName
132--> "Acknowledgements.rtf"
133
134#System Events  nameの取得
135tell application "System Events"
136   try
137      set strFileName to (name of aliasFilePath) as text
138      -->エラーになる
139   on error strErrMes number numErrNo
140      #エイリアス=実態参照させてからファイル名を取得する
141      set strFileName to (name of (aliasFilePath as alias)) as text
142   end try
143end tell
144
145log strFileName
146--> "Acknowledgements.rtf"
147
148
149####################################
150#【D: URL】:URLURL形式 
151#scripting additionsの機能を使いますので
152#use scripting additions の記述は必要になります
153#
154set urlFilePath to ("file:///Library/Documentation/Acknowledgements.rtf") as URL
155log class of urlFilePath
156--> URL
157log urlFilePath
158-->{class:URL, scheme:file URL (obsolete), path:file:///Library/Documentation/Acknowledgements.rtf}
159#戻り値がレーコード(properties)形式でnameが含まれていない場合は
160#パスにしてから
161set strFilePathURL to (path of urlFilePath) as text
162
163#テキスト形式のパスと同様の処理方法
164#delimiters区切り文字でリスト化して最後の項目
165set strDelim to AppleScript's text item delimiters
166set AppleScript's text item delimiters to "/"
167set listFilePathComponent to every text item of strFilePathURL
168set AppleScript's text item delimiters to strDelim
169set strFileName to (last item of listFilePathComponent) as text
170log strFileName
171--> "Acknowledgements.rtf"
172
173# zshの ${変数:修飾子}で取得する
174set strFileName to (do shell script "/bin/zsh -c 'STR_URL=\"" & strFilePathURL & "\";echo ${STR_URL:t}'") as text
175log strFileName
176
177#UNIX形式のファイルパスにしてから処理する方法もあります
178set strDelim to AppleScript's text item delimiters
179set AppleScript's text item delimiters to "/"
180set listFilePathComponent to every text item of strFilePathURL
181set listFilePath to (items 3 through -1 of listFilePathComponent) as list
182set strFilePath to listFilePath as text
183set AppleScript's text item delimiters to strDelim
184log strFilePath
185-->/Library/Documentation/Acknowledgements.rtf
186#エイリアスにしても良いでしょう
187set recordInfo to (info for (POSIX file strFilePath as alias)) as record
188set strFileName to (name of recordInfo) as text
189log strFileName
190--> "Acknowledgements.rtf"
191
192
193####################################
194#【E: specifier】:HFSFinder file形式
195#Finder内ならaliasと同じ処理方法が可能です
196tell application "Finder"
197   set fileFilePath to (file "Acknowledgements.rtf" of folder "Documentation" of folder "Library" of startup disk) as specifier
198   set strFileName to (name of fileFilePath) as text
199end tell
200log strFileName
201--> "Acknowledgements.rtf"
AppleScriptで生成しました

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#error number -128
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application
property refNSString : a reference to refMe's NSString
property refNSURL : a reference to refMe's NSURL

###################################
#######ダイアログ
###################################
####ダイアログで使うデフォルトロケーション
set aliasDefaultLocation to (path to desktop folder from user domain) as alias

####UTIリスト PDFのみ
set listUTI to {"public.item"}

####ダイアログを出す
set aliasFilePath to (choose file with prompt "ファイルを選んでください" default location (aliasDefaultLocation) of type listUTI with invisibles and showing package contents without multiple selections allowed) as alias

tell application "Finder"
set objInfo to info for aliasFilePath
####ファイル名取得
set strFileName to name of objInfo as text
log strFileName
-->ファイル名
end tell

set strFilePath to POSIX path of aliasFilePath
####ドキュメントのパスをNSString
set ocidFilePath to refNSString's stringWithString:strFilePath
####ドキュメントのパスをNSURL
set ocidNSUrlPath to refNSURL's fileURLWithPath:ocidFilePath
#####ファイル名取得
set ocidFileName to ocidNSUrlPath's lastPathComponent()
####ocid形式
log ocidFileName
-->ファイル名
log className() of ocidFileName as text
(*NSPathStore2*)

###テキスト形式
set strFileName to ocidFileName as text
log strFileName
-->ファイル名
log class of strFileName
(*text*)

|

[stringWithContentsOfURL]URLデータを取得(テキスト)

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos13なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application
property refNSString : a reference to refMe's NSString
property refNSURL : a reference to refMe's NSURL
property refNSData : a reference to refMe's NSData
property refNSMutableString : a reference to refMe's NSMutableString
property refNSMutableArray : a reference to refMe's NSMutableArray
property refNSPasteboard : a reference to refMe's NSPasteboard
set ocidPasteboard to refNSPasteboard's generalPasteboard()

###クリックボードの中のURLを取得
set ocidPasteboardTypeString to ocidPasteboard's stringForType:(refMe's NSPasteboardTypeString)

##可変テキスト形式で格納
set ocidCurlURL to refNSMutableString's alloc()'s initWithCapacity:0
ocidCurlURL's setString:ocidPasteboardTypeString

if (ocidCurlURL as text) starts with "curl" then
log "処理開始"
else
return "CURLとしてコピーしてください"
end if

####################################
###URLの処理
###改行を取る
set ocidCurlURLLength to ocidCurlURL's |length|()
set ocidCurlURLRange to {location:0, |length|:ocidCurlURLLength}
ocidCurlURL's replaceOccurrencesOfString:("\n") withString:("") options:(refMe's NSRegularExpressionSearch) range:ocidCurlURLRange

###'』でリスト化して2番目がURL
set ocidDelimiters to (refMe's NSCharacterSet)'s characterSetWithCharactersInString:"'"
set ocidCurlURLArray to ocidCurlURL's componentsSeparatedByCharactersInSet:ocidDelimiters

###URL確定(クエリー入り)
set ocidURLString to ocidCurlURLArray's objectAtIndex:1
set ocidURL to refNSURL's URLWithString:ocidURLString

###URL部分(クエリー無し)
set ocidURLComponents to (refMe's NSURLComponents)'s componentsWithURL:ocidURL resolvingAgainstBaseURL:true
ocidURLComponents's setQueryItems:(missing value)
set ocidBaseURL to ocidURLComponents's |URL|

###クエリー部分
set ocidQueryName to ocidURL's query()

###ヘッダー部
set ocidDelimiters to (refMe's NSCharacterSet)'s characterSetWithCharactersInString:"\\"
set ocidHeaderArray to ocidCurlURL's componentsSeparatedByCharactersInSet:ocidDelimiters
set ocidHeaderArrayLength to ocidHeaderArray's |count|()
set ocidHeaderRange to refMe's NSMakeRange(1, (ocidHeaderArrayLength - 1))
set ocidSubbArray to ocidHeaderArray's subarrayWithRange:ocidHeaderRange
set ocidHeaderText to (ocidSubbArray's componentsJoinedByString:"")

log ocidURL's absoluteString() as text
log ocidBaseURL's absoluteString() as text
log ocidQueryName as text
log ocidHeaderText as text

####################################
###URLからデータを取得

set listDownLoadData to refNSString's stringWithContentsOfURL:ocidURL encoding:(refMe's NSUTF8StringEncoding) |error|:(reference)
-->戻り値がList
####データ部
set ocidGetDataString to (item 1 of listDownLoadData)
####エラー情報(不要な場合は削除可)
set ocidNSErrorData to item 2 of listDownLoadData
if ocidNSErrorData is not (missing value) then
doGetErrorData(ocidNSErrorData)
return "エラー"
end if










to doGetErrorData(ocidNSErrorData)
#####個別のエラー情報
log "エラーコード:" & ocidNSErrorData's code() as text
log "エラードメイン:" & ocidNSErrorData's domain() as text
log "Description:" & ocidNSErrorData's localizedDescription() as text
log "FailureReason:" & ocidNSErrorData's localizedFailureReason() as text
log ocidNSErrorData's localizedRecoverySuggestion() as text
log ocidNSErrorData's localizedRecoveryOptions() as text
log ocidNSErrorData's recoveryAttempter() as text
log ocidNSErrorData's helpAnchor() as text
set ocidNSErrorUserInfo to ocidNSErrorData's userInfo()
set ocidAllValues to ocidNSErrorUserInfo's allValues() as list
set ocidAllKeys to ocidNSErrorUserInfo's allKeys() as list
repeat with ocidKeys in ocidAllKeys
if (ocidKeys as text) is "NSUnderlyingError" then
log (ocidNSErrorUserInfo's valueForKey:ocidKeys)'s localizedDescription() as text
log (ocidNSErrorUserInfo's valueForKey:ocidKeys)'s localizedFailureReason() as text
log (ocidNSErrorUserInfo's valueForKey:ocidKeys)'s localizedRecoverySuggestion() as text
log (ocidNSErrorUserInfo's valueForKey:ocidKeys)'s localizedRecoveryOptions() as text
log (ocidNSErrorUserInfo's valueForKey:ocidKeys)'s recoveryAttempter() as text
log (ocidNSErrorUserInfo's valueForKey:ocidKeys)'s helpAnchor() as text
else
####それ以外の値はそのままテキストで読める
try
log (ocidKeys as text) & ": " & (ocidNSErrorUserInfo's valueForKey:ocidKeys) as text
end try
end if
end repeat

end doGetErrorData

|

[NSURL]基礎ふたたび

結果は同じだけど、相対パスから絶対パスに展開するのには
stringByStandardizingPathを使うのが正解



#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application
property refNSString : a reference to refMe's NSString
property refNSURL : a reference to refMe's NSURL


set strFilePath to "~/Desktop"
set ocidRelativePath to refNSString's stringWithString:strFilePath
-->(*~/Desktop*)(*__NSCFString*)
set ocidFullPath to ocidRelativePath's stringByStandardizingPath
-->(*/Users/ユーザー名/Desktop*)(*NSPathStore2*)
set ocidDefaultLocation to refNSURL's alloc()'s initFileURLWithPath:ocidFullPath
-->(*Macintosh HD:Users:ユーザー名:Desktop:*)(*NSURL*)
set aliasDefaultLocation to ocidDefaultLocation as alias

set listChooseFile to (choose file with prompt "ファイルを選んでください" default location aliasDefaultLocation of type {"public.item"} with invisibles and multiple selections allowed without showing package contents) as list

repeat with objFile in listChooseFile
set strFilePath to POSIX path of objFile as text
tell application "Finder"
set objInfo to info for objFile
set strFileName to name of objInfo as text
set strExeName to name extension of objInfo as text
set aliasContainerDir to container of objFile as alias
end tell

set ocidFilePathURL to (refNSURL's alloc()'s initFileURLWithPath:strFilePath)
-->(*NSURL*)
set ocidFileName to ocidFilePathURL's lastPathComponent()
-->ファイル名(*NSPathStore2*)
set ocidFileExtensionName to ocidFilePathURL's pathExtension()
-->拡張子(*NSPathStore2*)
set strFileSystemRep to ocidFilePathURL's fileSystemRepresentation()
-->テキスト形式のPOSIX PATH(*text*)
set ocidContainerDirPathURL to ocidFilePathURL's URLByDeletingLastPathComponent()
-->URLのひとつ上の階層-->URLのディレクトリ(*NSURL*)
set ocidBaseFilePathURL to ocidFilePathURL's URLByDeletingPathExtension()
-->拡張子を取ったベースファイル名のURL


set ocidPath to ocidFilePathURL's |path|()
-->(*__NSCFString*) POSIX PATH 形式
set ocidAbsoluteStringPath to ocidFilePathURL's absoluteString()
-->RFC 形式(*__NSCFString*)
set ocidAbsoluteURL to ocidFilePathURL's absoluteURL()
-->(*NSURL*)
set ocidRelativeStringPath to ocidFilePathURL's relativeString()
-->RFC 形式(*__NSCFString*)
set ocidRelativePath to ocidFilePathURL's relativePath()
-->POSIX PATH(*__NSCFString*)
set ocidResourceSpecifier to ocidFilePathURL's resourceSpecifier()
-->:以降を%エンコードで(*__NSCFString*)
set ocidFileReferenceURL to ocidFilePathURL's fileReferenceURL()
-->(*NSURL*)
set ocidNewFilePathURL to ocidFilePathURL's URLByStandardizingPath()
-->(*NSURL*)
set ocidFilePathURL to ocidFilePathURL's filePathURL()
-->(*NSURL*)



end repeat



set strRelativePath to ("~/Desktop/") as text
(*~/Desktop/*)
set ocidRelativePath to refNSString's stringWithString:strRelativePath
(*~/Desktop/*)
(*__NSCFString*)
set ocidFullPath to ocidRelativePath's stringByExpandingTildeInPath()
(*/Users/ユーザー名/Desktop*)
(*NSPathStore2*)
set ocidFullPath to ocidRelativePath's stringByStandardizingPath()
(*/Users/ユーザー名/Desktop*)
(*NSPathStore2*)


#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application
property refNSString : a reference to refMe's NSString
property refNSURL : a reference to refMe's NSURL


set strRelativePath to ("~/Desktop/") as text
(*~/Desktop/*)
set ocidRelativePath to refNSString's stringWithString:strRelativePath
(*__NSCFString*)
set ocidFullPath to ocidRelativePath's stringByStandardizingPath()
(*/Users/ユーザー名/Desktop*)
(*NSPathStore2*)

set ocidFullPathURL to refMe's NSURL's fileURLWithPath:ocidFullPath
log ocidFullPathURL as text
log className() of ocidFullPathURL as text
(*Macintosh HD:Users:ユーザー名:Desktop:*)
(*NSURL*)
log ocidFullPathURL's |path|() as text
(*/Users/ユーザー名/Desktop*)
log ocidFullPathURL's absoluteString() as text
(*file:///Users/ユーザー名/Desktop/*)
log ocidFullPathURL as text
(*Macintosh HD:Users:ユーザー名:Desktop:*)
log ocidFullPathURL as alias
(*alias Macintosh HD:Users:ユーザー名:Desktop:*)

|

[filePathURL]alias形式リードオンリー

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application
property refNSString : a reference to refMe's NSString
property refNSURL : a reference to refMe's NSURL


#############################################

###デスクトップ
set strFilePath to ("~/Desktop/")
###NSStringにして
set ocidPosixPath to refNSString's stringWithString:strFilePath
##NSStringフルパスにして
set strBaseFilePath to ocidPosixPath's stringByStandardizingPath

set ocidBaseFilePath to refMe's NSURL's fileURLWithPath:strBaseFilePath
log ocidBaseFilePath as text
(*Macintosh HD:Users:ユーザー名:Desktop:*)
log className() of ocidBaseFilePath as text
(*NSURL*)




set strRelativePath to "名称未設定" as text
###NSStringにして
set ocidRelativePath to refNSString's stringWithString:strRelativePath
log ocidRelativePath as text
(*名称未設定*)
log className() of ocidRelativePath as text
(*__NSCFString*)
####パスに使える文字列を定義
set ocidNSCFCharacterSet to refMe's NSCharacterSet's URLPathAllowedCharacterSet()
####パスに使える文字列に変換
set ocidEncodedString to ocidRelativePath's stringByAddingPercentEncodingWithAllowedCharacters:ocidNSCFCharacterSet
log ocidEncodedString as text
(*%E5%90%8D%E7%A7%B0%E6%9C%AA%E8%A8%AD%E5%AE%9A*)
log className() of ocidEncodedString as text
(*__NSCFString*)



set ocidNSUrlPath to refNSURL's alloc()'s initWithString:ocidEncodedString relativeToURL:ocidBaseFilePath
log ocidNSUrlPath's |path|() as text
(*/Users/ユーザー名/Desktop/名称未設定*)
log className() of ocidNSUrlPath as text
(*NSURL*)


set ocidPathURL to ocidNSUrlPath's filePathURL()
log ocidPathURL as text
(*Macintosh HD:Users:ユーザー名:Desktop:名称未設定*)
log className() of ocidPathURL as text
(*NSURL*)

|

[fileReferenceURL]alias形式 参照先

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application
property refNSString : a reference to refMe's NSString
property refNSURL : a reference to refMe's NSURL


#############################################

###デスクトップ
set strFilePath to ("/tmp")
###NSStringにして
set ocidPosixPath to refNSString's stringWithString:strFilePath


#############################################

set ocidFilePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:ocidPosixPath
log ocidFilePathURL's |path|() as text
(*/tmp*)
log ocidFilePathURL's absoluteString() as text
(*file:///tmp/*)
log ocidFilePathURL as alias
(*alias Macintosh HD:private:tmp:*)
log className() of ocidFilePathURL as text
(*NSURL*)

####参照先
set ocidReferenceURL to ocidFilePathURL's fileReferenceURL()
log ocidReferenceURL as text
(*Macintosh HD:private:tmp*)
log className() of ocidReferenceURL as text
(*NSURL*)

####シンボリックリンクか?どうか?
set boolIsFileReferenceURL to ocidFilePathURL's isFileReferenceURL()
log boolIsFileReferenceURL
if boolIsFileReferenceURL is false then
log "パスはエイリアスです"
else if boolIsFileReferenceURL is true then
log "パスはオリジナルです"
end if



#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application
property refNSString : a reference to refMe's NSString
property refNSURL : a reference to refMe's NSURL


#############################################

###デスクトップ
set strFilePath to ("~/Desktop/")
###NSStringにして
set ocidPosixPath to refNSString's stringWithString:strFilePath
##NSStringフルパスにして
set strBaseFilePath to ocidPosixPath's stringByStandardizingPath

set ocidBaseFilePath to refMe's NSURL's fileURLWithPath:strBaseFilePath
log ocidBaseFilePath as text
(*Macintosh HD:Users:ユーザー名:Desktop:*)
log className() of ocidBaseFilePath as text
(*NSURL*)


set strRelativePath to "名称未設定フォルダ" as text
###NSStringにして
set ocidRelativePath to refNSString's stringWithString:strRelativePath
log ocidRelativePath as text
(*名称未設定*)
log className() of ocidRelativePath as text
(*__NSCFString*)
####パスに使える文字列を定義
set ocidNSCFCharacterSet to refMe's NSCharacterSet's URLPathAllowedCharacterSet()
####パスに使える文字列に変換
set ocidEncodedString to ocidRelativePath's stringByAddingPercentEncodingWithAllowedCharacters:ocidNSCFCharacterSet
log ocidEncodedString as text
(*%E5%90%8D%E7%A7%B0%E6%9C%AA%E8%A8%AD%E5%AE%9A*)
log className() of ocidEncodedString as text
(*__NSCFString*)


set ocidNSUrlPath to refNSURL's alloc()'s initWithString:ocidEncodedString relativeToURL:ocidBaseFilePath
log ocidNSUrlPath's |path|() as text
(*/Users/ユーザー名/Desktop/名称未設定フォルダ*)
log className() of ocidNSUrlPath as text
(*NSURL*)

set ocidReference to ocidNSUrlPath's fileReferenceURL()
log ocidReference as text
(*Macintosh HD:Users:ユーザー名:Desktop:名称未設定フォルダ:*)
if ocidReference is (missing value) then
log "そのパスは実在しません"
else
log ocidReference as text
(*Macintosh HD:Users:ユーザー名:Desktop:名称未設定フォルダ:*)
log className() of ocidReference as text
(*NSURL*)
end if

|

[initWithString]URLの初期化

変数の名称を再利用できますので使います



#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application
property refNSString : a reference to refMe's NSString
property refNSURL : a reference to refMe's NSURL


#############################################

set strBaseFilePath to "/Library/Documentation/"


set ocidNSUrlPath to refMe's NSURL's alloc()'s initWithString:strBaseFilePath
log ocidNSUrlPath's |path|() as text
log className() of ocidNSUrlPath as text


set ocidBaseFilePath to refMe's NSURL's fileURLWithPath:strBaseFilePath
log ocidBaseFilePath as text
(*Macintosh HD:Library:Documentation:*)
log className() of ocidBaseFilePath as text
(*NSURL*)

set strRelativePath to "名称未設定フォルダ" as text
###NSStringにして
set ocidRelativePath to refNSString's stringWithString:strRelativePath
log ocidRelativePath as text
(*名称未設定*)
log className() of ocidRelativePath as text
(*__NSCFString*)
####パスに使える文字列を定義
set ocidNSCFCharacterSet to refMe's NSCharacterSet's URLPathAllowedCharacterSet()
####パスに使える文字列に変換
set ocidEncodedString to ocidRelativePath's stringByAddingPercentEncodingWithAllowedCharacters:ocidNSCFCharacterSet
log ocidEncodedString as text
(*%E5%90%8D%E7%A7%B0%E6%9C%AA%E8%A8%AD%E5%AE%9A*)
log className() of ocidEncodedString as text
(*__NSCFString*)



set ocidNSUrlPath to refNSURL's alloc()'s initWithString:ocidEncodedString relativeToURL:ocidBaseFilePath
log ocidNSUrlPath's |path|() as text
(*/Library/Documentation/名称未設定フォルダ*)
log className() of ocidNSUrlPath as text
(*NSURL*)

|

[initFileURLWithPath:relativeToURL:]ベースURLとパスアイテム

WithPath
同じディレクトリ(ベースURL)にある複数のURL(ファイル)を処理するときに便利



#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application
property refNSString : a reference to refMe's NSString
property refNSURL : a reference to refMe's NSURL


#############################################

###デスクトップ
set strFilePath to ("~/Desktop/")
###NSStringにして
set ocidPosixPath to refNSString's stringWithString:strFilePath
##NSStringフルパスにして
set strBaseFilePath to ocidPosixPath's stringByStandardizingPath
log strBaseFilePath as text
(*/Users/ユーザー名/Desktop*)
log className() of strBaseFilePath as text
(*NSPathStore2*)

#############################################

set ocidFilePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:strBaseFilePath
log ocidFilePathURL's |path|() as text
(*/Users/ユーザー名/Desktop*)
log ocidFilePathURL's absoluteString() as text
(*file:///Users/ユーザー名/Desktop/*)
log ocidFilePathURL as alias
(*Macintosh HD:Users:ユーザー名:Desktop:*)
log className() of ocidFilePathURL as text
(*NSURL*)

#############################################
set strRelativePath to "名称未設定フォルダ"

###NSStringにして
set ocidRelativePath to refNSString's stringWithString:strRelativePath
log ocidRelativePath as text
(*名称未設定フォルダ*)
log className() of ocidRelativePath as text
(*__NSCFString*)
####パスに使える文字列を定義
set ocidNSCFCharacterSet to refMe's NSCharacterSet's URLPathAllowedCharacterSet()
####パスに使える文字列に変換
set ocidEncodedURL to ocidRelativePath's stringByAddingPercentEncodingWithAllowedCharacters:ocidNSCFCharacterSet
log ocidEncodedURL as text
(*%E5%90%8D%E7%A7%B0%E6%9C%AA%E8%A8%AD%E5%AE%9A*)
log className() of ocidEncodedURL as text
(*__NSCFString*)


set ocidRelativePathURL to refNSURL's alloc()'s initFileURLWithPath:ocidEncodedURL relativeToURL:ocidFilePathURL
log ocidRelativePathURL's |path|() as text
(*/Users/ユーザー名/Desktop/%E5%90%8D%E7%A7%B0%E6%9C%…*)
log ocidRelativePathURL's |path|() as text
(*/Users/ユーザー名/Desktop/%E5%90%8D%E7%A7%B0%E6%9C%…*)
log ocidRelativePathURL's absoluteString() as text
(*file:///Users/ユーザー名/Desktop/%E5%90%8D%E7%A7%B0%E6%9C%…*)
log ocidRelativePathURL as text
(*Macintosh HD:Users:ユーザー名:Desktop:%E5%90%8D%E7%A7%B0%E6%9C%…*)
log className() of ocidRelativePathURL as text
(*NSURL*)


set ocidRelativePathBaseURL to ocidRelativePathURL's baseURL()
log ocidRelativePathBaseURL's |path|() as text
(*/Users/ユーザー名/Desktop*)
log ocidRelativePathBaseURL's absoluteString() as text
(*file:///Users/ユーザー名/Desktop/*)
log ocidRelativePathBaseURL as alias
(*Macintosh HD:Users:ユーザー名:Desktop:*)
log className() of ocidRelativePathBaseURL as text
(*NSURL*)

|

[initFileURLWithPath:isDirectory:]URL作成(ディレクトリであるか?を指定)

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application
property refNSString : a reference to refMe's NSString
property refNSURL : a reference to refMe's NSURL

#############################################

set strBaseFilePath to "/Library/Documentation/"

set ocidBaseFilePath to refMe's NSURL's fileURLWithPath:strBaseFilePath isDirectory:true
log ocidBaseFilePath as text
(*Macintosh HD:Library:Documentation:*)
log className() of ocidBaseFilePath as text
(*NSURL*)

set ocidNSUrlPath to refMe's NSURL's alloc()'s initFileURLWithPath:strFilePath isDirectory:true
log ocidNSUrlPath as text
(*Macintosh HD:Library:Documentation:*)
log className() of ocidNSUrlPath as text
(*NSURL*)

|

[URLWithString:relativeToURL:]ベースURLにパスアイテム

同じディレクトリ(ベースURL)にある複数のURL(ファイル)を処理するときに便利



#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application
property refNSString : a reference to refMe's NSString
property refNSURL : a reference to refMe's NSURL

#############################################


set strBaseFilePath to "/Library/Documentation/"

set ocidBaseFilePath to refMe's NSURL's fileURLWithPath:strBaseFilePath isDirectory:true
log ocidBaseFilePath as text
(*Macintosh HD:Library:Documentation:*)
log className() of ocidBaseFilePath as text
(*NSURL*)


set strRelativePath to "名称未設定" as text
###NSStringにして
set ocidRelativePath to refNSString's stringWithString:strRelativePath
log ocidRelativePath as text
(*名称未設定*)
log className() of ocidRelativePath as text
(*__NSCFString*)
####パスに使える文字列を定義
set ocidNSCFCharacterSet to refMe's NSCharacterSet's URLPathAllowedCharacterSet()
####パスに使える文字列に変換
set ocidEncodedURL to ocidRelativePath's stringByAddingPercentEncodingWithAllowedCharacters:ocidNSCFCharacterSet
log ocidEncodedURL as text
(*%E5%90%8D%E7%A7%B0%E6%9C%AA%E8%A8%AD%E5%AE%9A*)
log className() of ocidEncodedURL as text
(*__NSCFString*)

set ocidNSUrlPath to refMe's NSURL's alloc()'s initFileURLWithPath:ocidEncodedURL isDirectory:false relativeToURL:ocidBaseFilePath
log ocidNSUrlPath as text
(*Macintosh HD:Library:Documentation:%E5%90%8D%E7%A7%B0%E6%9C%AA%E8%A8%AD%E5%AE%9A*)
log className() of ocidNSUrlPath as text
(*NSURL*)
####baseURLを認識する
log ocidNSUrlPath's baseURL() as text
(*Macintosh HD:Library:Documentation:*)
log (className() of (ocidNSUrlPath's baseURL())) as text
(*NSURL*)

|

[initFileURLWithPath]NSURLの初期化

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application
property refNSString : a reference to refMe's NSString
property refNSURL : a reference to refMe's NSURL


#############################################


set strBaseFilePath to "/Library/Documentation/"

set ocidBaseFilePath to refMe's NSURL's fileURLWithPath:strBaseFilePath
log ocidBaseFilePath as text
(*Macintosh HD:Library:Documentation:*)
log className() of ocidBaseFilePath as text
(*NSURL*)


set ocidBaseFilePath to refMe's NSURL's alloc()'s initFileURLWithPath:strBaseFilePath
log ocidBaseFilePath as text
(*Macintosh HD:Library:Documentation:*)
log className() of ocidBaseFilePath as text
(*NSURL*)

|

その他のカテゴリー

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