ファイル指定まとめ

"/hoge/moge/" -- ディレクトリ
"hoge/moge"   -- ファイル
  • パッケージ化されたファイルをfileパスに変換するとディレクトリ扱いになる(あたりまえ)
"/hoge/moge.app" as POSIX file
        --> file "hoge:moge.app:"

POSIXパス

fileパス参照 -> POSIXパス

POSIX path of file "何か架空の:パスの:ファイル"
        --> "/何か架空の/パスの/ファイル"

fileパスの文字列 -> POSIXパス

POSIX path of "何か架空の:パスの:フォルダ:"
        --> "/何か架空の/パスの/フォルダ/"

POSIXパスの文字列 -> fileパス参照

"/何か架空の/パスの/ファイル" as POSIX file
        --> file "HD:何か架空の:パスの:ファイル"

fileパス参照

  • コロン(フォルダ指定の場合は、最後にコロンを付る)
file "HD:テキスト:日記:"
set thePath to "HD:テキスト:日記" -- これは文字列
info for file thePath

aliasパス

fileパスの文字列 -> aliasパス

"HD:テキスト:日記" as alias
        --> alias "HD:テキスト:日記"

aliasパス -> fileパスの文字列

(alias "HD:テキスト:日記") as string
        --> "HD:テキスト:日記"