1 2 3 Previous Next 37 Replies Latest reply: Apr 16, 2013 11:44 PM by kelhak1 Go to original post
  • 30. Re: (re)Enable iCalendar ability to execute AppleScript
    LinuxGeek3447 Level 1 Level 1 (20 points)

    I totally didn't stop to look at saving the automator script as a .app file. I just went with what I knew about Automator's ability to run applescript files. I tried your suggestion, and it works (I didn't expect it to fail). Thanks for catching that - it simplifies the process, and I learned something new.

  • 31. Re: (re)Enable iCalendar ability to execute AppleScript
    LinuxGeek3447 Level 1 Level 1 (20 points)

    Duplicate comment removed

  • 32. Re: (re)Enable iCalendar ability to execute AppleScript
    Mark Saper Level 1 Level 1 (10 points)

    Has anyone figured out a way to get information of the Calendar event that opens the Applescript/automator application? 

  • 33. Re: (re)Enable iCalendar ability to execute AppleScript
    ozymandias1 Level 1 Level 1 (0 points)

    If you are talking about trying to pass an argument to the script, I have the same question.  Any luck?

  • 34. Re: (re)Enable iCalendar ability to execute AppleScript
    SU Level 1 Level 1 (105 points)

    have you found this to be a bit flakey in 10.8.2 and 10.8.3?  Not always running. 

  • 35. Re: (re)Enable iCalendar ability to execute AppleScript
    Lenny Eiger Level 1 Level 1 (5 points)

    I use Script Debugger to write scripts, as I am sure many of you do as well. Why do I have to copy and paste a serious script into a toy program like Automator to get it to run? It's offensive.

     

    Second, if Apple has decided to disallow running scripts in iCal, why won't they disable it in Automator next? Why is it not the same? In fact, you can even run scripts on a remote computer with Automator - now there's a security issue. Will it be 10.4 or 10.5? Then we would have to start all over again.

     

    It's probably not security at all, its moving us to "Finderless" applications like Automator - because we apparently can't do real business apps like the people who use PC's. I've been doing business apps on the Mac since 1985 and I am so getting tired of this.

     

    I guess I have to learn launchd after all....

  • 36. Re: (re)Enable iCalendar ability to execute AppleScript
    kelhak1 Level 1 Level 1 (140 points)

    Hi,

     

    Note that you don't need to choose 'open file' from the Automator calendar. You can choose the Automator Calendar workflow with 'open file', directly from within any Calendar. Someone had posted the location of where your Calendar workflows are stored. Also, note that you need to be able to access your home folder Library from with the choose file dialog. Just add the user Lirary folder to the sidebar.

     

    gl,

  • 37. Re: (re)Enable iCalendar ability to execute AppleScript
    kelhak1 Level 1 Level 1 (140 points)

    Hi Mark,

     

    You can get the event 'summary' (Calendar dictionary term) by ui scripting the alert window in Notification Center.

     

    You might be able to get it from the temporary file created whose reference is passed as a parameter to the run handler of the Calendar workflow script. Although I haven't tried looking at this temporary file yet. Here's an example of getting the passed parameters:

     

    on run {input, parameters}

     

              (* Your script goes here *)

              display dialog "It works!"

              --set c to class of parameters

              --set c to (count input)

              --display dialog (c as string)

              tell application "Finder"

                        activate

                        set the clipboard to parameters

              end tell

              activate me

     

              return input

    end run

     

    After the parameters are sent to the clipboard, you can get them with this from the Script Editor:

     

    --set r to {a:1, b:2, c:3}

    tell application "Finder"

      activate

      --set the clipboard to ""

              set c to the clipboard

    end tell

    list of c

    --

     

    The result is something like this:

     

    {"temporary items path", "/var/folders/r9/0t1l8pd17kd1275j1dwnbrdw0000gn/T/572D6A11-9937-4EB9-82AA-1DCBC CDE4AF3/1/com.apple.Automator.RunScript", "ignoresInput", false, "source", "on run {input, parameters}

     

              (* Your script goes here *)

              display dialog \"It works!\"

              --set c to class of parameters

              --set c to (count input)

              --display dialog (c as string)

              tell application \"Finder\"

                        activate

                        set the clipboard to parameters

              end tell

              activate me

     

              return input

    end run", "action", item id 1 of application "Finder"}

     

    I wonder what is in that file? A simple read of that file might work.

     

    gl,

1 2 3 Previous Next