Hi Everyone,
Long time no see! I’ve got this (nine year old) blog post that still gets some hits. It’s a tutorial on scheduling Quicktime Recordings with Automator. As Mac OS and QT have changed over time I’ve needed to tweak the guide to keep it functioning. That time has come again.
There are two automations at play: start a QT recording, end the recording. The new issue comes with ending the recording as QT used to automatically save the movie as soon as you stopped it. That no longer happens. Once the recording stops I need one more step to save the file.
So…I have developed a little bit of a workaround to get this functioning, but I would like to clean it up with an AppleScript Save As, if possible. When I’ve tried to save the file with a simple “save the font document” (or any other permutation of the same) I end up with a permission error. “The document “Untitled” could not be saved as “Movie.mov”. You don’t have permission” (I was trying to save it to the desktop.)
The stop/save script would look something like this:
tell application "QuickTime Player"
try
stop document 1 -- to stop capture
end try
delay 2
save the front document in "/Users/UserName/Desktop/Movie.mov"
end tell
But with the permission error I strung together some other moves to get it going. I’m essentially using System Events to emulate keystrokes to get this done. In Automator I have a “Run AppleScript” action that stops the recording, then I have another Run AppleScript action that handles the saving, like this:
tell application "QuickTime Player"
activate
end tell
tell application "System Events" to keystroke "w" using command down
delay 1
tell application "System Events" to keystroke "d" using command down
delay 1
tell application "System Events" to keystroke return
Keystroke W, tries to close the recording, Keystroke D pushes it to the Desktop, Keystroke return forces the save. So again, this does work alright. But part of me wants to do it a little more cleanly with a “Save As” instead.
Otherwise, I simply have the above action run, then an Automator Pause, then a Rename Finder Items action, then a “Move Finder Items” action.
I’m sure I’m missing something simple with the “Save As”.
Thanks for your time!