Created
June 25, 2013 22:07
-
-
Save joyrexus/5862897 to your computer and use it in GitHub Desktop.
Shell script that records and saves a quicktime audio file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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