【问题标题】:Unable to get filename into alias无法将文件名转换为别名
【发布时间】:2013-11-04 17:56:31
【问题描述】:

这个小程序

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 / 表示法提供)

【问题讨论】:

    标签: applescript itunes


    【解决方案1】:

    试试:

    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。
    猜你喜欢
    • 1970-01-01
    • 2012-04-30
    • 2014-12-10
    • 2015-11-16
    • 2010-11-06
    • 2012-07-26
    • 1970-01-01
    • 1970-01-01
    • 2012-12-19
    相关资源
    最近更新 更多