如何获取iTunes选择的文件路径

Kar*_*er 3 macos applescript itunes

我正在尝试使用AppleScript确定在iTunes中选择的曲目路径.它似乎不是track班级的财产.谁能告诉我如何获取文件路径?

小智 7

试试这个:

--gets file path of selected song
tell application "iTunes"
 set songLocation to get location of selection
end tell
return songLocation

--gets file path of currently playing song
tell application "iTunes"
 set songLocation to get location of current track
end tell
return songLocation
Run Code Online (Sandbox Code Playgroud)