Mac AppleScript help

VolceOntra

macrumors 6502
Original poster
Apr 25, 2007
292
46
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

macrumors 6502a
Mar 17, 2012
996
59
Belgium
Code:
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

macrumors 6502
Original poster
Apr 25, 2007
292
46
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?