AppleScript:在另一个程序 [Riffstation] 中打开当前 iTunes 曲目

AppleScript: open current iTunes track in another program [Riffstation]

我是 AppleScript 的新手,不是程序员,所以我希望有人能帮助我...

我想在 iTunes 中获取当前曲目路径并在另一个程序中打开文件 [Riffstation]

这似乎应该可行,但它不可行:

tell application "iTunes"
    set songLocation to get location of current track
end tell

tell application "Riffstation"
    open songLocation
end tell

任何帮助将不胜感激!!!

Riffstation 不支持 AppleScript,因此您必须要求 Finder 打开文件并将其传递给 Riffstation

tell application "iTunes"
    set songLocation to get location of current track
end tell
tell application "Finder" to open songLocation using application file id "com.SonicLadder.Riffstation"

如果您想忽略 .m4p 文件,请使用

tell application "iTunes" to set {location:songLocation, kind:songKind} to current track
if songKind is not "Protected AAC audio file" then
    tell application "Finder" to open songLocation using application file id "com.SonicLadder.Riffstation"
end if