Bem, eu consegui inventar algo (leia-se: hack sujo) que realiza o que eu quero. Eu usei um script AppleScript e de interface do usuário por meio de Sikuli . Ele pode e deve ser muito melhorado, como, com uma melhor verificação de erros e tolerância a falhas. Eu basicamente tive que tomar conta dela enquanto passava por todo o processo, porque cada dúzia de arquivos iria sufocar em alguma coisa. Dito isto, serviu aos meus propósitos e cumpriu o meu objetivo.
global theCount
set theCount to 0 as number
tell application "Finder"
set theFolder to choose folder with prompt "Select a directory:"
display dialog "This script will open each QuickTime movie file contained within this folder and its subfolders in QuickTime Player 7, and change the Author attribute to an Artist attribute using the Sikuli IDE. Proceed?"
my processFiles(theFolder)
display dialog (theCount as string) & " files processed."
end tell
on processFiles(theFolder)
tell application "System Events"
set theItems to get the name of every disk item of theFolder
end tell
set theFolder to theFolder as string --do this to concatenate with item name in loop
repeat with i from 1 to length of theItems --this is the loop that works on each file in the current folder
set theItem to item i of theItems
set theItem to (theFolder & theItem) as alias --get a file object
set itemInfo to info for theItem --get the file's info
if visible of itemInfo is true then --only work on invisibles
if folder of itemInfo is false then --and check for folders first or next line will fail
if type identifier of itemInfo is "com.apple.quicktime-movie" then
try --makes this more fault-tolerant
tell application "QuickTime Player 7"
open theItem
end tell
set theCount to theCount + 1
do shell script "java -jar /Applications/Sikuli-IDE.app/Contents/Resources/Java/sikuli-script.jar /Users/username/Desktop/flip\ to\ artist\ source.sikuli" --Sikuli has a better command line interface, but it wasn't working on the current build. This is connecting directly to its java executable, and is REALLY slow as a result.
end try
end if
else if folder of itemInfo is true then
do shell script "touch \"" & POSIX path of theItem & "\"" --do this to track the progress of the script based on folder modification date
my processFiles(theItem) --operate recursively until all files are processed
end if
end if
end repeat
end processFiles
O script Sikuli é essencialmente:
switchApp("QuickTime Player 7")
keyDown(Key.CMD)
type("j")
keyUp(Key.CMD)
click([Author annotation tag])
click([Artist option])
keyDown(Key.CMD)
type("s")
keyUp(Key.CMD)
keyDown(Key.CMD)
type("w")
keyUp(Key.CMD)
keyDown(Key.CMD)
type("w")
keyUp(Key.CMD)
waitVanish([a QuickTime window])
Eu não sou um desenvolvedor experiente de Sikuli, mas quase certamente as impressoras de tecla devem ser colocadas no AppleScript como ações de interface do usuário. Essa parte não é difícil. É o clique de escolhas que é difícil. O AppleScript também pode verificar o atributo Author; esse material está documentado no dicionário AppleScript, mas a propriedade é somente leitura.