"Can’t get alias of" 使用 applescript

"Can’t get alias of" using applescript

我正在制作一个脚本,其中变量设置为文件夹路径。我告诉 finder 为该文件夹创建一个别名,但我收到了一个错误。

tell application "Finder"
    make alias of art to desktop
end tell

错误:Can’t get alias of "PATH:TO:FILE"

试试这个:

set originalFIle to (choose file)
tell application "Finder" to make new alias file to originalFIle at desktop