smkd

Q: (re)Enable iCalendar ability to execute AppleScript

Hi there fellow early adopters of ML (i'm talking to those who wait the final release and never installed ML DP).

 

I were using tons of AppleScript with Calendar ability to run script. Is there any way to recover this ability in Mountain Lion ?

 

Thanks,

MacBook Pro, OS X Mountain Lion

Posted on Jul 26, 2012 2:36 AM

Close

Q: (re)Enable iCalendar ability to execute AppleScript

  • All replies
  • Helpful answers

first Previous Page 3 of 3
  • by LinuxGeek3447,

    LinuxGeek3447 LinuxGeek3447 Aug 15, 2012 9:17 PM in response to Jorsta
    Level 1 (20 points)
    Aug 15, 2012 9:17 PM in response to Jorsta

    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.

  • by LinuxGeek3447,

    LinuxGeek3447 LinuxGeek3447 Aug 15, 2012 9:22 PM in response to Jorsta
    Level 1 (20 points)
    Aug 15, 2012 9:22 PM in response to Jorsta

    Duplicate comment removed

  • by Mark Saper,

    Mark Saper Mark Saper Aug 27, 2012 1:38 PM in response to smkd
    Level 1 (10 points)
    Aug 27, 2012 1:38 PM in response to smkd

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

  • by ozymandias1,

    ozymandias1 ozymandias1 Feb 17, 2013 10:29 PM in response to Mark Saper
    Level 1 (0 points)
    Feb 17, 2013 10:29 PM in response to Mark Saper

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

  • by SU,

    SU SU Mar 29, 2013 3:15 PM in response to LinuxGeek3447
    Level 1 (113 points)
    Safari
    Mar 29, 2013 3:15 PM in response to LinuxGeek3447

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

  • by Lenny Eiger,

    Lenny Eiger Lenny Eiger Apr 16, 2013 11:05 AM in response to smkd
    Level 1 (5 points)
    Apr 16, 2013 11:05 AM in response to smkd

    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....

  • by kelhak1,

    kelhak1 kelhak1 Apr 16, 2013 8:24 PM in response to smkd
    Level 2 (215 points)
    Apr 16, 2013 8:24 PM in response to smkd

    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,

  • by kelhak1,

    kelhak1 kelhak1 Apr 16, 2013 11:44 PM in response to Mark Saper
    Level 2 (215 points)
    Apr 16, 2013 11:44 PM in response to Mark Saper

    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,

first Previous Page 3 of 3