I am looking for a solution to control Quicktime using Applescript. All I need to do is - - open quicktime and start a recording - stop the recording and save the file to a set location.
From previous posts I managed to get the following.
set theFilePath to "/Users/jamestebb/Desktop/01TestRecords/ " & "myfile" & ".mov"
tell application "QuickTime Player"
set newMovieRecording to new movie recording
tell newMovieRecording
start
delay 5
pause
save newMovieRecording in POSIX file theFilePath
stop
close newMovieRecording
end
This works perfectly however, for this project I need separate script cues to start and stop the recording as opposed to having a wait / delay.
To start the recording I used.
set theFilePath to "/Users/jamestebb/Desktop/01TestRecords/ " & "myfile" & ".mov"
tell application "QuickTime Player"
set newMovieRecording to new movie recording
tell newMovieRecording
start
end tell
end tell
This works fine however when I try to stop the recording using the below I get errors where Pause is not understood
set theFilePath to "/Users/jamestebb/Desktop/01TestRecords/ " & "myfile" & ".mov"
tell application "QuickTime Player"
set MovieRecording to new movie recording
tell MovieRecording
pause
save MovieRecording in POSIX file theFilePath
stop
close MovieRecording
end tell
end tell
Im guessing that this is because the file currently recording is no longer a "new movie recording"
Any ideas soon how to fix??