Applescript 无法将文件名导入别名

Applescript 无法将文件名导入别名,applescript,itunes,Applescript,Itunes,这是苹果书 tell application "iTunes" set new_playlist to get first user playlist whose id is 20721 set nexttrack to (add(POSIX file ( get "/Users/paul/tmp/Music4/My Bloody Valentine - m b v - 2013 [FLAC][24-96][WEB]/09 Wonder 2.flac") as alias) to new_pla

这是苹果书

tell application "iTunes"
set new_playlist to get first user playlist whose id is 20721
set nexttrack to (add(POSIX file ( get "/Users/paul/tmp/Music4/My Bloody Valentine - m b v - 2013 [FLAC][24-96][WEB]/09 Wonder 2.flac") as alias) to new_playlist)
set trackname to name of nexttrack
end tell
失败于

javax.script.ScriptException: The variable nexttrack is not defined.
我认为前面的线路有问题,但我看不出有什么问题。(注意,起点是unix/notation中提供的文件名)

尝试:

set songAlias to alias (POSIX file "/Users/paul/tmp/Music4/My Bloody Valentine - m b v - 2013 [FLAC][24-96][WEB]/09 Wonder 2.flac")

tell application "iTunes"
    set new_playlist to get first user playlist whose id is 20721
    set nexttrack to add songAlias to new_playlist
    set trackname to name of nexttrack
end tell

这可能会产生一些不同,我不确定是否会被标记为正确。但我在我的例子中意识到我使用的是flac文件,而iTunes不支持flac。