iCal "Run Script" alert opens .scpt file in AppleScript Editor instead of running it

Discussion in 'Mac Programming' started by drskot, Jun 6, 2012.

  1. drskot
    Expand Collapse
    macrumors newbie

    Joined:
    Jul 11, 2010
    #1
    I think I've followed the instructions right on how to schedule a script to run, but when the alert fires, instead of running the script gets opened in AppleScript Editor.

    Here's what I did:

    - Created a new event in iCal
    - Under "alert" chose "Run Script"
    - located my script file "running.scpt"
    - typed "1" next to "minutes before"

    What am I doing wrong? Running Lion 10.7.4, iCal 5.0.3.
     
  2. kryten2
    Expand Collapse
    macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
    #2
    Can you post your script code? Put your code between the code tags. What instructions did you follow?
     
  3. drskot
    Expand Collapse
    thread starter macrumors newbie

    Joined:
    Jul 11, 2010
    #3
    After trying what seemed straightforward in the user interface, I found several descriptions of the procedure online, which seemed to confirm what I had already guessed. For example:

    http://www.tuaw.com/2008/04/14/mac-101-schedule-your-scripts/
    http://www.dssw.co.uk/blog/2011/01/12/how-to-use-ical-to-run-an-applescript/
    http://www.hawkwings.net/2005/12/09/make-an-ical-event-run-an-applescript/

    The script I'm trying to run for now is simply this:

    Code:
    tell application "iCal" to activate
    saved in a file called, optimistically, "running.scpt".

    If I type at the command line

    Code:
    osascript running.scpt
    the script does what it's meant to do (bring iCal to the front), but if I set it as an iCal alarm, it just opens in AppleScript Editor.

    Thanks for your help...
     
  4. kryten2
    Expand Collapse
    macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
    #4
    The script runs fine here. It activates (brings iCal to the front). I'm running Leopard 10.5.8, iCal 3.0.8. Sure you didn't choose Open file instead of Run script?
     

    Attached Files:

Share This Page