Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Recording tweaks

  • Loading branch information...
commit cfcf6b38c5633a2aaa82640a86ebd6f039dd57ba 1 parent 4451230
@holman holman authored
Showing with 24 additions and 1 deletion.
  1. +24 −1 script/record
View
25 script/record
@@ -3,9 +3,15 @@
# Handles recording of system audio.
#
# $1 - The function to perform. Possible values:
-#
# start - Starts recording.
# stop - Stops recording.
+# $2 - The name to append to the recording. Possibly a username. Only required
+# for stopping.
+#
+# Examples:
+#
+# record start
+# record stop github-dj-holman
if test "$1" = "start"
then
@@ -23,4 +29,21 @@ else
stop document 1
end tell
APPLESCRIPT
+
+ # Sleep so QuickTime doesn't get confused
+ sleep 5
+
+ # Import recording
+ filename="$2-$(date +%Y-%m-%d_%H%M%S)"
+ mv "$HOME/Movies/Audio Recording.m4a" "$HOME/Movies/$filename.m4a"
+ script/add-to-itunes "$HOME/Movies/$filename.m4a"
+ rm -rf "$HOME/Movies/$filename.m4a"
+
+ # Close out
+ osascript << APPLESCRIPT
+ tell application "QuickTime Player"
+ activate
+ close document 1
+ end tell
+APPLESCRIPT
fi
Please sign in to comment.
Something went wrong with that request. Please try again.