iTunes: Length of Track

I know how to get title, artist, album and the rest, but how do I get the length of the track? Like say a song is 3 minutes long. I want it to return as seconds. So 3 minutes = 180 seconds. I’ve searched these forums, checked Doug’s Scripts but couldn’t find anything.

Assuming we’re talking about iTunes, the property you are seeking is called “duration”.

that works …

tell application "iTunes"
	set track_time to (duration of current track as string)
end tell

Of course it does. That’s what the docs say. :slight_smile:

Tell me about it, the Libraries are always the first place people should look, But they do not always make sense. Or show you the real way of structuring the syntax.

I also wish they had some sort of thesaurus search, I spent 10 minutes prating about with the ‘time’ property and trying to get that to work, because my keyword ‘time’ did not bring up duration