Hey, I was trying to get metadata information from MKV and OGM files. The following script I found here does the job, but its INCREDIBLY slow. the script works reasonably quickly for my needs for avi and mp4 files, but if I’m indexing large lists of MKVs, it takes nearly a minute per file. Is there a different way to get the file information? mdls for the mkv files does not contain the information I need.
set Movie_s to choose file with multiple selections allowed without invisibles
set the duration_log to (path to desktop folder) & "Duration Log" as string
set open_duration_log to open for access the duration_log with write permission
set eof of the open_duration_log to 0
close access the open_duration_log
repeat with m_ovie in Movie_s
set m_ovie to m_ovie as string
tell application "System Events"
tell QuickTime file m_ovie
set keyfileduration to duration / time scale
set n_ame to name
set the time_scale to the time scale
set the movie_duration to the duration
set the h_ours to (((movie_duration / time_scale) div 60) div 60) as string
end tell
end tell
if h_ours is "0" then
set h_ours to "00"
end if
set m_inutes to (((movie_duration / time_scale) div 60) - 60) as string
if m_inutes < "0" then
set m_inutes to ((movie_duration / time_scale) div 60) as string
end if
set count_minutes to count characters of m_inutes
if count_minutes is 1 then
set m_inutes to "0" & m_inutes as string
end if
set s_econds to (((((movie_duration / time_scale / 60) - ((movie_duration / time_scale) div 60)) * 60) * 10 div 10) as string)
set count_seconds to count characters of s_econds
if count_seconds is 1 then
set s_econds to "0" & s_econds as string
end if
set movie_length to h_ours & ":" & m_inutes & ":" & s_econds as string
set open_duration_log to open for access the duration_log with write permission
write n_ame & "
Duration: " & movie_length & "
" to the open_duration_log starting at eof
close access the open_duration_log
end repeat
set duration_log to duration_log as alias
tell application "Finder"
open duration_log
end tell
thanks,
Jeff