PDA

View Full Version : AppleScript help




VolceOntra
Aug 13, 2012, 09:28 PM
Hi,

I'm wondering if someone will help me write a simple applescript that will ask a user to enter a series of times in seconds and then have it beep after every time those seconds pass.

all I could come up with is a static method using:

delay 4
beep
delay 9
beep

Extra points if I could save or over lap the beeps over an mp3 file


:) I appreciate it



kryten2
Aug 14, 2012, 09:35 AM
display dialog "Enter a series of times in seconds like 1 2 3 etc" default answer "1 2 3"
set theTimes to text returned of the result
try
set oldDelims to AppleScript's text item delimiters -- save their current state
set AppleScript's text item delimiters to {" "} -- declare new delimiters
set these_items to the text items of theTimes
set AppleScript's text item delimiters to oldDelims -- restore them
on error
set AppleScript's text item delimiters to oldDelims -- restore them in case something went wrong
end try
repeat with anItem in these_items
delay anItem
beep
end repeat

VolceOntra
Aug 14, 2012, 11:51 AM
That's awesome. Thank you so much. Is there any way to save the beeps to an MP3 or overlay them onto of an MP3?

kryten2
Aug 14, 2012, 02:28 PM
Is there any way to save the beeps to an MP3 or overlay them onto of an MP3?

The only thing I can think of is Audio Hijack Pro. It's able to hijack System Audio.

VolceOntra
Aug 14, 2012, 03:49 PM
Thank you so much sir