Eu encontrei este script online em algum lugar e estou tentando fazer com que ele verifique constantemente se o Final Cut Express está renderizando e quando termina a renderização, ele exibe uma notificação Growl.
EDIT: minha pergunta é: como faço para obter o script constantemente verificar para ver se o FCE está renderizando e uma vez que é feito renderização, exibir uma notificação? O script funciona para exibir a notificação, agora como faço para que funcione corretamente?
EDIT: eu tentei usar um manipulador ocioso. Não funcionou, mas talvez eu não esteja usando o manipulador ocioso corretamente.
Aqui está o código do script:
tell application "System Events"
tell application process "Final Cut Express HD"
set windowList to get name of every window
end tell
end tell
if windowList contains missing value then
end if
tell application "GrowlHelperApp" -- ** the daemon that is behind the scenes
-- Make a list of all the notification types that this script will ever send:
-- ** They really mean "ever" or you'll have to reregister.
set the allNotificationsList to {"Render Complete"}
-- , "Another Test Notification"}
--** Enable another notification
-- Make a list of the notifications that will be enabled by default.
-- ** We'll see shortly that a note must be enabled and the user can disable it.
-- Notifications not enabled by default can be enabled later in the 'Applications' tab of the growl prefpane.
set the enabledNotificationsList to {"Render Complete"} -- ** just one turned on, the other not.
-- Register our script with growl.
-- You can optionally (as here) set a default icon for this script's notifications.
-- ** Theoretically, you only have to register once, but there is absolutely no harm in doing
-- it every time the script runs, i.e., leaving this line in your script.
register as application "Final Cut Render Complete Script" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "Final Cut Express HD"
-- Send a Notification...
-- This one will appear because it was enabled by default.
notify with name "Render Complete" title "Render Complete" description "Your Render has Finished." application name "Final Cut Render Complete Script"
-- This one will not appear -- it wasn't enabled by default so the user has to turn it on in the 'Applications' tab of the Growl prefpane to see it.
-- Take out the comments to enable it.
--notify with name "Another Test Notification" title "Another Test Notification " description "Alas you won't see me until you enable me yourself..." application name "Final Cut Render Complete Script"
end tell