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

时间:2015-11-07 15:04:26

标签: applescript

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

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

中打开该文件

似乎这应该有效,但它没有:

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

tell application "Riffstation"
    open songLocation
end tell

任何帮助都将非常感谢!!!

1 个答案:

答案 0 :(得分:1)

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