Snow Leopard Quicktime Recording Script

Helps Automate Audio Recordings in Snow Leopard’s Quicktime Player
WIll split recordings by running it again later

-- SLAudioRecExample v0.0.1
-- Quicktime Audio Recording Script 
-- by Todd Bruss
-- © 2011 NiceMac.com
-- AS IS, NO WARRANTY
-- YOU HAVE PERMISSION TO MAKE CHANGES, DISTRIBUTE, FOR FREE
-- PayPal Donations: nicemac (dot) llc (at) gmail (dot) com

--Requires: Snow Leopard Mac OS X 10.6.x
--Recommended: Cycling 74's SoundFlower (Audio Router / Virtual Mic)
--Recommended by not required: StarLight 1.0.4 SXM Emulator by NiceMac

-- what you want to call the beginning of the file
-- change this to anything you like
set myFileName to "SLAudioRec"

-- save it to your Documents Folder (Can also be Movies:) 
-- or any folder that is already created in your home folder
set myDocumentsFolder to "Documents:"

-- time stamp for file
set myDay to day of (current date) as integer as string
set myMonth to month of (current date) as integer as string
set myYear to year of (current date) as integer as string
set myMin to minutes of (current date) as integer as string
set myHour to hours of (current date) as integer as string

-- add padding to timestamp
set myDay to text (count of characters of myDay) thru -1 of ("0" & myDay)
set myMonth to text (count of characters of myMonth) thru -1 of ("0" & myMonth)
set myYear to text (count of characters of myYear) thru -1 of ("0" & myYear)
set myMin to text (count of characters of myMin) thru -1 of ("0" & myMin)
set myHour to text (count of characters of myHour) thru -1 of ("0" & myHour)

-- example timeStamp
-- you'll probably want to customize this
set myTimeStamp to myMin & myHour & "_" & myDay & myMonth & myYear

--Path to your home folder
set myHomeFolder to path to home folder

--Build the fileName
set saveFile to (myHomeFolder & myDocumentsFolder & myFileName & "_" & myTimeStamp & ".mov") as string

--Talk to QuickTIme Player
tell application "QuickTime Player"
	-- if an AudioRecording is running
	-- stop it and then write down its new name
	set savePrevData to false
	if document "Audio Recording" exists then
		set savePrevData to true
		try
			tell document 1
				stop
				set nameOfDoc to name
			end tell
		end try
	end if
	
	-- start a new recording
	set newAudioRecording to new audio recording
	tell newAudioRecording
		start
	end tell
	
	-- if there was a previous recording
	--let's save the data! Seamlessly
	if savePrevData then
		tell document nameOfDoc
			save in file saveFile
			close without saving
		end tell
	end if
end tell

Hi,

the time stamp can be simplified with


set myTimeStamp to do shell script "/bin/date +%M%H_%d%m%y"

is there a way to set the “quality” of the audio recording to “maximum” in applescript?

Model: macbook pro
Browser: Safari 537.73.11
Operating System: Mac OS X (10.8)