Re: Durations of mp3 files?
Re: Durations of mp3 files?
- Subject: Re: Durations of mp3 files?
- From: "Steven D. Majewski" <email@hidden>
- Date: Thu, 7 Dec 2006 15:40:28 -0500
'mdls' of an mp3 will give you kMDItemDurationSeconds (among many
other items).
Something like:
last word of (do shell script 'mdls ' & ( posix path of ... ) & "|
grep kMDItemDurationSeconds" )
ought to work ( but I suspect there *must* be a more direct way to
get the info in Applescript ).
-- Steve Majewski
On Dec 7, 2006, at 3:14 PM, Mr Tea wrote:
This from Luther Fuller - dated 7/12/06 7.20 pm:
Both QuickTime Player and iTunes contain a 'duration' command.
...and I think you probably have to open the file to use it.
QuickTime Player might be the way to go. I knocked this up in a
couple of
minutes and got a usable result.
tell application "QuickTime Player"
open alias "Shed!:iTunes Music:Slam:Warparty D & House AB:Positive
Education.mp3"
set theLength to round (duration of movie of window 1) / 600
set trackname to name of window 1
close window 1
end tell
set {theMinutes, theSeconds} to {theLength div 60, theLength mod 60}
set showTime to trackname & " - " & theMinutes & ":" & theSeconds
--> Positive Education - 6:32
I'm sure this could be adapted/tidied up and made into a useful
droplet or
script menu item for the purposes of the OP.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden