1

Applescript で、パスを保存したいファイルを選択しています (後で開きます)。

ファイルのパスを文字列として保存しようとしたときに、次のエラーが表示されました。

エラー「エイリアス \"Macintosh HD:Users:Username:Desktop:Folder:File.xls\" のパスを文字列型にできません。」エイリアス「Macintosh HD:Users:Username:Desktop:Folder:File.xls」のパスから数値 -1700 を文字列に

後でこのファイルを開くときに思い出せるように、このファイル パスを効果的に保存するにはどうすればよいですか?

アップルスクリプト:

tell application "Finder"
    set filePath to path of (choose file) as string
    set fileName to name of file filePath
end tell

*注: 私も試しas textました。

4

1 に答える 1

1

これはうまくいくようです:

tell application "Finder"
    set filePathAlias to (choose file)
    set fileName to name of filePathAlias
    set filePath to filePathAlias as string
end tell
于 2013-06-06T15:21:47.467 に答える