Applescript - Stopping a recording

byunerd

Registered
I am using Run Revolution to make a program that will do 3 things:
Screen recording
Audio recording
combining the two into one mp4 or aiff

I have a button that does this apple script:
tell application "QuickTime Player"
activate
start new screen recording
end tell

I am trying to figure how to stop the recording now, I have tried this script but it is not working:
tell application "QuickTime Player"
stop new screen recording
end tell

Do I need to make give a name to the video recording before it starts, so that I will have a filename to stop??
I am lost
 
The "new screen recording" command creates a new screen recording document. So "stop new screen recording" basically means, make a new recording and stop it, which isn't what you want at all. You want to stop the EXISTING screen recording. You can access it from QuickTime Player's documents list, like so:
Code:
tell application "QuickTime Player"
	stop document "screen recording"
end tell

The original "new screen recording" command also returns a reference to the newly created document. So you could also do something like this:
Code:
tell application "QuickTime Player"
	set sr to new screen recording
	start sr
	--later.....
	stop sr
end tell
 
Back
Top