Applescript - How to iterate over tracks

Posted by Bob Rivers on Stack Overflow See other posts from Stack Overflow or by Bob Rivers
Published on 2010-05-02T22:45:21Z Indexed on 2010/05/02 22:47 UTC
Read the original article Hit count: 241

Filed under:
|

Hi,

I'm a newbie in applescript. I was trying to learn it from various sources, such as Doug's site, macscripter and this forum

Just for learning purposes, I was trying to print on the screen all the tracks names using this code:

tell application "iTunes"
    set myTracks to (tracks of library playlist 1)
    repeat with aTrack in myTracks
        get name of aTrack
    end repeat
end tell

But it only prints one track name, probably the last one...

So, how is the best way to iterate over a list?

TIA,

Bob

© Stack Overflow or respective owner

Related posts about applescript

Related posts about itunes