So I've been using a script before I updated to Catalina that worked fine for screen recording. It's based on another user's SE question, but ever since the update, it looks like there is a new step.
Basically, you tell "QuickTime Player" to start (new screen recording).
But instead of a screen recording starting, it just opens a new menu which lets you select some settings, or click the screen to record using the last used settings.
I've tried using System Events to click to screen, even after a 1s delay, but it's not working.
Anyone know how to either:
- Bypass the new menu and just start recording right away
- Start recording once the menu has popped up (System Events doesn't detect window 1, so I'm not even sure how to navigate the UI)
- Click the screen/UI using System Events
*** Update to question ***
I've edited my AppleScript code since user3439894 wrote a response. It seems to work for what I've asked. The only problem now is that I'm not sure how to save to file to a specific path. Below, I've added some code snippets of what I currently have since making edits (it just saves the screen recording to the Desktop based on the date for the time. Below that, I have my original code which saves it on the Desktop as test.mov
.
My code now, after edits
1) Starting recording
tell application "QuickTime Player" to activate
tell application "QuickTime Player" to start (new screen recording)
tell application "System Events" to tell process "Screen Shot"
repeat until exists its front window
delay 0.1
end repeat
if not (exists button "Record" of its front window) then
click checkbox "Record Entire Screen" of its front window
end if
click button "Record" of its front window
end tell
2) end recording
tell application "System Events" to click menu bar item 1 of menu bar 1 of application process "screencaptureui"
My Code Before Edits
3) Old way I used to start my recording before Catalina for screen recording (still works for webcam (aka Movie) recording)
tell application "QuickTime Player" to activate
tell application "QuickTime Player" to start (new screen recording)
4) Old way I used to stop and save my screen recording that doesn't work in Catalina
set filePath to "Users:mini:Desktop:test.mov"
set f to a reference to file filePath
tell application "QuickTime Player"
pause document "screen recording"
save document "screen recording" in f using settings preset "1080p"
stop document "screen recording"
close document "screen recording"
end tell