Skip to content

Instantly share code, notes, and snippets.

@joyrexus
Created June 25, 2013 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joyrexus/5862897 to your computer and use it in GitHub Desktop.
Save joyrexus/5862897 to your computer and use it in GitHub Desktop.
Shell script that records and saves a quicktime audio file.
#!/bin/sh
#
# usage:
# record.sh SECS FILE
#
# e.g.:
# record.sh 10 ~/Documents/Trials/08/audio
record() {
result=`osascript -e \
'tell application "QuickTime Player"
activate
close every window saving no
set audioRecording to (new audio recording)
tell audioRecording
start
delay '$1'
stop
end tell
save
close every window saving no
end tell'`
echo $result
}
SECS=$1
FILE="./$2.mov"
record $SECS
mv ~/Movies/Audio*Recording.mov $FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment