基本iTunes AppleScript问题

基本iTunes AppleScript问题,applescript,itunes,Applescript,Itunes,感觉像一个真正的骨头头在这里,只是想知道如何让这个脚本插入艺术家选择的名字,并把它放入专辑艺术家 tell application "iTunes" set theTracks to (item 1 of (get selection)) set theTracks to selection repeat with theTrack in theTracks set albumartist to artist of theTrack end repeat end tell

感觉像一个真正的骨头头在这里,只是想知道如何让这个脚本插入艺术家选择的名字,并把它放入专辑艺术家

tell application "iTunes"
  set theTracks to (item 1 of (get selection))
  set theTracks to selection
  repeat with theTrack in theTracks
    set albumartist to artist of theTrack
  end repeat
end tell
像这样:

tell application "iTunes"
    set theTracks to (item 1 of (get selection))
    set theTracks to selection
    repeat with theTrack in theTracks
        set albumartist to artist of theTrack
        set album artist of theTrack to albumartist -- the missing line
    end repeat
end tell
在现实生活中,我可能会跳过中间变量,将这对行写成一行,如下所示:

        set album artist of theTrack to (get artist of theTrack)
或者更好:

        tell theTrack to set album artist to (get artist)