让这个Apple Script在iTunes中播放一首歌的特定部分的最佳方法是什么?

时间:2012-06-24 03:39:50

标签: applescript

我希望iTunes播放播放列表中每首歌的特定60秒(比如秒60-120)。什么是完成此任务的AppleScript代码?到目前为止,我有:

tell application "iTunes"
    repeat with i from 1 to count tracks of playlist "My Playlist"
        play track i of playlist "My Playlist"
    end repeat
end tell

1 个答案:

答案 0 :(得分:1)

尝试:

tell application "iTunes"
    set trackCount to count of tracks of playlist "My Playlist"
    repeat with i from 1 to trackCount
        play track i of playlist "My Playlist"
        set player position to 60
        repeat until player position ≥ 120
            delay 0.5
        end repeat
    end repeat
end tell