set aFile to choose file
tell application "Finder" to set filename to name of aFile
set AppleScript's text item delimiters to " = "
set duration to text item 2 of (do shell script "mdls -name kMDItemDurationSeconds " & quoted form of (POSIX path of aFile))
set AppleScript's text item delimiters to "."
set total_seconds to text item 1 of duration
set AppleScript's text item delimiters to ""
set showsec to (total_seconds as integer) mod 60
set showmin to (total_seconds as integer) div 60
display dialog filename & return & return & "Duration:" & return & showmin & " min " & showsec & " sec"
Your email is never published nor shared. Required fields are marked *
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
CAPTCHA: 4 + = nine
Notify me of followup comments via e-mail
Subscribe without commenting E-Mail:
AppleScript: Länge einer Audio-Datei auslesen
set aFile to choose file
tell application "Finder" to set filename to name of aFile
set AppleScript's text item delimiters to " = "
set duration to text item 2 of (do shell script "mdls -name kMDItemDurationSeconds " & quoted form of (POSIX path of aFile))
set AppleScript's text item delimiters to "."
set total_seconds to text item 1 of duration
set AppleScript's text item delimiters to ""
set showsec to (total_seconds as integer) mod 60
set showmin to (total_seconds as integer) div 60
display dialog filename & return & return & "Duration:" & return & showmin & " min " & showsec & " sec"