无法弄清楚这个循环-我希望仅在 myText 更改(即个人正在收听的专辑更改)时重复以下函数-我已经能够使其循环一定次数或在曲目事件中重复更改,但我希望它在专辑更改时重复。
tell application "iTunes"
repeat if myText changes
if player state is playing then
set albumName to (get album of current track)
set myText to text 1 thru 10 of albumName
end if
end repeat
end tell
open location "http://bandsite.com/shows/" & myText
当代码在没有重复命令的情况下工作时,它看起来像这样:
tell application "iTunes"
if player state is playing then
set albumName to (get album of current track)
set myText to text 1 thru 10 of albumName
end if
end tell
open location "http://bandsite.com/shows/" & myText
如果 myText 发生变化,我需要重复整个函数