PDA

View Full Version : Applescript alarm for iCal




michaelk242
Nov 17, 2009, 04:24 AM
Hey all, Im creating a script thatll integrate with ical, and as youll see itll be a pretty nice alarm. My problem that Im hoping I can get help fixing is that, although the command to hide pandora is their, it doesnt work when run from ical. I also need to bring the dialog to the front, since for some reason ical also neglects to do that as well. I will greatly appreciate your help.:confused:

Note, volume is set low for testing purposes. And redundant code is their because Im a noob.:D

set volume output volume 20
tell application "PandoraMan" to activate
delay 3
tell application "Finder" to set visible of process "PandoraMan" to false
delay 10
set question to display dialog "Good Morning, Snooze set to 30 min.!" buttons {"Snooze!!", "I'm Awake!!"} default button 2
set answer to button returned of question
tell application "PandoraMan" to activate
if answer is equal to "Snooze!!" then
tell application "PandoraMan" to quit
delay 1800
tell application "PandoraMan" to activate
tell application "Finder" to set visible of process "PandoraMan" to false
end if

if answer is equal to "I'm Awake!!" then
tell application "PandoraMan" to quit
end if