(感到沮丧,我无法通过'where ...'命令来解决这个问题。) 如何将我的iTunes资料库中的歌曲添加到我的播放列表xMusic中,确保它尚未添加? 目前我有一个'添加一些歌曲,其类型是...'命令,然后一个单独的脚本删除重复,但我宁愿确保我不是首先添加重复。 有没有办法我可以写一些类似'将歌曲设置为播放列表音乐的某些歌曲,其流派是摇滚,其名称不是{通过迄今为止添加到xMusic的所有其他曲目的标题} 将歌曲复制/复制到xMusic'。
答案 0 :(得分:1)
use application "iTunes"
set thePlaylistThatNeedsMoreSongs to user playlist "Music To Die To"
--> user playlist id 22255 of source id 66 of application "iTunes"
set theSongIWantToAdd to the first file track whose artist is "Raign"
-- These are the playlists that contain theSongIWantToAdd
playlists of theSongIWantToAdd
--> {user playlist id 20895 of source id 66 of application "iTunes",¬
--> user playlist id 22255 of source id 66 of application "iTunes"}
-- Now check if thePlaylistThatNeedsMoreSongs is in that list:
id of thePlaylistThatNeedsMoreSongs is in id of playlists of theSongIWantToAdd
if the result is true then
"Pick another track"
else
add theSongIWantToAdd to thePlaylistThatNeedsMoreSongs
end if
这就是你想要的吗?