Skip to content

Instantly share code, notes, and snippets.

@vojtaholik
Created October 12, 2023 09:28
Show Gist options
  • Save vojtaholik/ded540fc8b553751887adbc03abcca90 to your computer and use it in GitHub Desktop.
Save vojtaholik/ded540fc8b553751887adbc03abcca90 to your computer and use it in GitHub Desktop.
// Menu: Record Screen
// Shortcut: shift cmd 5
/** @type {import("@johnlindquist/kit")} */
await applescript(`
-- # Setup to do a screen recording.
# tell application "QuickTime Player" to new screen recording
-- # Start the screen recording.
tell application "System Events" to tell process "Screen Shot"
repeat until exists button "Record" of its front window
delay 0.1
end repeat
click button "Record" of its front window
end tell
-- # Set the time in seconds you want the recording to be.
delay 2
-- # Stop the recording.
tell application "System Events" to ¬
click menu bar item 1 ¬
of menu bar 1 ¬
of application process "screencaptureui"
`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment