What I am trying to do is update the following script that runs a bunch of tech spec checks on .mxf files to ensure they meet a certain criteria. The script I currently have uses Quicktime Player 7 to read the info and is here:
on open theseFiles
set theErrorCounter to 0
set theNotaNumber to 0
set theNotaNumberCounter to 0
set theNoS4M to 0
set theNoS4MCounter to 0
set counter to 0
set counterTime to 0
set theErrorFiles to 0
set theErrorList to ""
set theList to ""
set theTimeList to ""
set theNoS4MList to ""
set theTimeListNoCheck to ""
set theRightFormats to {"MPEG IMX 525/60 (30 Mb/s)", "XDCAM HD422 1080i60 (50 Mb/s VBR)"} as list
repeat with thisFile in theseFiles
try
tell application "Finder"
set extension hidden of thisFile to false
end tell
set theName to name of (info for thisFile)
set thePath to the POSIX path of thisFile
set n to the number of characters in theName
set n to (n - 11)
set theRealName to (characters n through end of theName) as string
set theNewPath to quoted form of ("/Volumes/iMac_HD/Promo/" & theRealName)
set theOldpath to quoted form of thePath
set theErrorCounter to 0
on error
set theErrorCounter to 1
end try
if theErrorCounter is equal to 0 then
try
tell application "QuickTime Player 7"
launch
repeat
if document 1 exists then
close document 1
else
exit repeat
end if
end repeat
open thisFile
set visible of window of document 1 to false
set theNameSpaced to name of document 1
set theFormat to the data format of track "Video Track" of document 1
set theDuration to the (number of frames of the track "Video Track" of document 1)
set theNumber to the first word of theName
set theS4MNumber to the word -2 of theName
set theRealNameNumber to the first word of theRealName
set theFPS to the time scale of document 1
set theFPSround to round (theFPS / 100)
try
set theCalc to theNumber * theFPSround
on error
set theNotaNumber to 1
end try
if the number of characters of theS4MNumber is equal to 8 then
try
set theS4MCalc to (theS4MNumber + 2)
on error
set theNoS4M to 1
end try
else
set theNoS4M to 1
end if
close document 1
if the number of characters of theRealNameNumber is not equal to 8 then
set theNoS4M to 1
end if
end tell
set theName to do shell script ("echo " & theNameSpaced & " | tr -s ' '")
set theErrorCounter to 0
on error
set theErrorCounter to 1
end try
end if
if theErrorCounter is equal to 0 then
tell application "Finder"
if theNoS4M is not equal to 0 then
set label index of thisFile to 4
set theNoS4MList to theNoS4MList & theName & "
"
set theNoS4MCounter to theNoS4MCounter + 1
set theNoS4M to 0
else
if theFormat is not in theRightFormats then
set label index of thisFile to 2
set counter to counter + 1
set theList to theList & theName & "
" & " • codec is " & theFormat & "
"
else
if theNotaNumber is not equal to 0 then
set label index of thisFile to 7
set theTimeListNoCheck to theTimeListNoCheck & theName & "
"
set theNotaNumberCounter to theNotaNumberCounter + 1
set theNotaNumber to 0
else
if theNotaNumber is equal to 0 and (theDuration is greater than (theCalc + 1) or theDuration is less than (theCalc - 1)) then
set label index of thisFile to 3
set counterTime to counterTime + 1
set theTimeList to theTimeList & theName & "
" & " • length is " & (round (theDuration / 30)) & " seconds
"
else
set label index of thisFile to 6
do shell script "cp " & theOldpath & " " & theNewPath
end if
end if
end if
end if
end tell
set theErrorCounter to 0
end if
if theErrorCounter is not equal to 0 then
tell application "Finder"
set label index of thisFile to 5
set theErrorFiles to theErrorFiles + 1
set theErrorList to theErrorList & (name of (info for thisFile)) & "
"
end tell
end if
end repeat
tell application "QuickTime Player 7"
quit
end tell
tell application "Finder"
if theNoS4MList is not equal to "" then
display dialog "..." & theNoS4MCounter & " file(s) do not have a proper S4M number...
" & theNoS4MList & "
(Label color: blue)" buttons "Thanks"
end if
if theTimeListNoCheck is not equal to "" then
display dialog "..." & theNotaNumberCounter & " file(s) were not checked for duration...
" & theTimeListNoCheck & "
(Label color: gray)" buttons "Thanks"
end if
if counter is not equal to 0 then
display dialog "..." & counter & " file(s) were not the proper format...
" & theList & "
(Label color: red)" buttons "Thanks"
end if
if counterTime is not equal to 0 then
display dialog "..." & counterTime & " file(s) were not the proper time...
" & theTimeList & "
(Label color: yellow)" buttons "Thanks"
end if
if theErrorFiles is not equal to 0 then
display dialog "..." & theErrorFiles & " file(s) were not correctly processed...
" & theErrorList & "
(Label color: purple)" buttons "Thanks"
end if
if counter is equal to 0 and theErrorFiles is equal to 0 and counterTime is equal to 0 and theTimeListNoCheck is equal to "" and theNoS4MList is equal to "" then
display dialog "All OK!" & "
(Label color: green)" buttons "Thanks"
end if
end tell
end open
I’m trying to replace Quicktime Player 7 with a new program because my company is phasing out Quicktime 7. MediaInfo was the software that was recommended we update our script to. I’m just not experienced enough to get it to work with MediaInfo/XML metadata.