Skip to content

Instantly share code, notes, and snippets.

@fuji246
Created March 19, 2020 18:42
Show Gist options
  • Save fuji246/2b3ad2e355e105ae031c98f08b9ea0eb to your computer and use it in GitHub Desktop.
Save fuji246/2b3ad2e355e105ae031c98f08b9ea0eb to your computer and use it in GitHub Desktop.
script for play recording with QuickTime Player
#!/usr/bin/osascript
on play_video(recording_path)
tell application "QuickTime Player"
if it is not running then
log "play video: " & recording_path
set filepath to (recording_path as POSIX file)
set theMovie to open file filepath
tell theMovie
set the presenting to true
set the looping to true
play
end tell
--use this to see what properties can be modified
--get the properties of theMovie
end if
end tell
end play_video
on stop_video()
tell application "QuickTime Player" to quit
end stop_video
on run argv
set helpStr to "Usage: playrecording.applescript [start recording_path | stop]"
set action to "none"
if length of argv is not less than 1 then
set action to item 1 of argv
else
return helpStr
end if
if action is equal to "start" then
set recording_path to item 2 of argv
play_video(recording_path)
else if action is equal to "stop" then
stop_video()
else
return helpStr
end if
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment