-- An example script using the GUI Scripting beta software -- First, set some standard variables like name and time and channel -- This also helps, so that you don't have to set these multiple times in the script -- when you're editing it at the command line. property timerName : "Test Timer" -- start time is the hour over the 24 hour day. property startTime : 12 -- recordingTime is in minutes property recordingTime : "45" property channel : "kwmu.asf" property bitrate : "64 Kbps" property days : {1, 2, 3, 5, 6, 7} tell application "Audio Hijack Pro" to activate -- may not need to activate applicaton tell application "System Events" tell application process "Audio Hijack Pro" -- first, we need to open the list of recordings and the recording times, -- which is called the "Presets List". -- To do this, we'll use keystroke. The keystroke for this is command-1 -- it doesn't close the window if you hit it while it's open keystroke 1 using command down -- if you want to, you can click a menu item like the following line: -- click menu item "Show Presets" of menu "Window" of menu bar 1 -- next, we need to create a new preset click button "New" of tool bar 1 of window "Presets List" -- I'm renaming the new item from "untitled preset" to the timer name tell window "Presets List" tell table 1 of scroll area 1 set presetNum to get count of rows if presetNum is greater than 0 then set value of text field 1 of row presetNum to timerName set selected of row presetNum to true else error "Something went wrong when I added an preset. Stopping script" end if end tell click button "Open" of tool bar 1 end tell tell window timerName -- open all of the needed areas first if not (exists (button "Mute" of scroll area 1)) then click button "Control" of scroll area 1 end if if not (exists (group 4 of scroll area 1)) then click button "Recording" of scroll area 1 end if if not (exists (checkbox "Timer Enabled" of scroll area 1)) then click button "Timer" of scroll area 1 end if end tell -- make the selections for control click menu item "Select Target..." of menu "Control" of menu bar 1 keystroke "/" using control down set filePath to "/users/stevko/Desktop/" & channel tell sheet 1 of window "Open" set value of text field 1 to filePath click button 1 end tell click button "Open" of window "Open" tell window timerName -- make selections for recording -- change type tell pop up button 1 of group 1 of scroll area 1 click click menu item "MP3" of menu 1 end tell delay 1 -- change stereo/mono tell pop up button 2 of group 1 of scroll area 1 click click menu item "Stereo" of menu 1 end tell delay 1 -- change bitrate tell pop up button 3 of group 1 of scroll area 1 click pick menu item bitrate of menu 1 end tell delay 1 -- set recording value to minutes tell pop up button 1 of group 4 of scroll area 1 click pick menu item "Minutes" of menu 1 end tell delay 1 -- set recording time tell text field 1 of group 4 of scroll area 1 set value to recordingTime end tell -- make selections for timer -- first, select timer enabled. if (value of checkbox "Timer Enabled" of scroll area 1 is equal to 0) then click checkbox "Timer Enabled" of scroll area 1 end if if (value of checkbox "Record" of group 6 of scroll area 1 is equal to 0) then click checkbox "Record" of group 6 of scroll area 1 end if if (value of checkbox "Quit Target" of group 6 of scroll area 1 is equal to 0) then click checkbox "Quit Target" of group 6 of scroll area 1 end if -- setting array of days set daysLength to length of days repeat with counter from 1 to daysLength set thisDay to item counter of days as number click button thisDay of list 1 of group 5 of scroll area 1 end repeat -- getting end time set endTime to startTime + (recordingTime div 60) if (recordingTime mod 60 > 0) then set endTime to endTime + 1 end if -- setting start time repeat startTime times increment incrementor 2 of group 5 of scroll area 1 end repeat -- setting end time repeat endTime times increment incrementor 1 of group 5 of scroll area 1 end repeat end tell end tell end tell