iTunes durations of Track

I have gone nutz looking thru the forums for help but don’t seem to see it anywhere so here we go

Writing a small script to help load my sql database with information of tracks I have in the library.

I have ran into the duration time of the track but can’t seem to break it down to it’s original time.

tell application "iTunes"
     set the the_duration to duration of track 1 of view of browser window 1
     -- I this as a result 
     -- the_duration =  207.960006713867
     -- how do I convert the_duration into 3:27 ???
end tell

Thanks!!! anyone!!!

Hi,

is there a special reason, why you don’t take the property time directly

tell application "iTunes"
	set the the_time to time of track 1 of view of browser window 1
end tell

but, just for fun, the “coercion” of duration

tell application "iTunes"
	tell ((duration of track 1 of view of browser window 1) div 1) to set the_duration to (it div 60 as string) & ":" & (it mod 60 as string)
end tell

StefanK

 Thanks for speedy reply... all works.. thanks so much!

:slight_smile: Krazay :smiley: