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

    LinuxGeek3447 wrote:

    . . .

    Open Calendar.app, create a new event

     

              Select the Automator calendar as your reference calendar

     

              Select Open File for the alert, and select the file you created in Automator.

    For me, all those steps were already done after I saved it as a Calendar Alarm -- so it's even easier.  Just set the time & repeat frequency.

     

    Very cool!  

     

     

    Now, a question:  since you only have 10 points here, you're not authorized to create a User Tip (see https://discussions.apple.com/static/apple/tutorial/reputation.html).

     

    But this would be good one.  If you haven't seen them, click the User Tips tab at the top of the forum list:

     

    Screen Shot 2012-07-30 at 6.57.32 PM.png

     

     

    If you'd like to rewrite your instructions in a fashion similar to the first 3 (mine just link to my website), perhaps including the screenshots "in line," I'd be happy to copy it and make it a User Tip, crediting you prominently as the author of course (although it will show me).

     

    Then not only will some folks find it on their own, but others can post links to it.

     

    EDIT: And I'll link to it from my Changes in Mountain Lion page.

     

    .

     

    Message was edited by: Pondini

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

    Let me know if this rewrite works.

     

    If you have AppleScripts designed to execute from Calendar, you may find that they no longer work in Mountain Lion. Fortunately, there is a work-around that will restore the Calendar's ability to run your scripts by using Automator.

     

    I use an AppleScript to provide an alarm clock function. Here's how I used Automator to allow execution of the script:

     

    In Automator, create a Calendar Alarm

     

    1a.png

    Select Utilities from the library pane

     

              Select & drag Run AppleScript into the workflow area

     

              Copy/paste the AppleScript into the Run AppleScript box

    2a.png

     

              Save the newly created Calendar Alarm

     

    Open Calendar.app, create a new event

     

              Select the Automator calendar as your reference calendar

    3.png

              Select Open File for the alert, and select the file you created in Automator. By default, iCal is           the file that comes up when you select Open File. Change that to the name of the Automator           app you created. Select Other if the file name isn't shown.

  • 17. Re: (re)Enable iCalendar ability to execute AppleScript
    Pondini Level 8 Level 8 (38,720 points)

    Yup. Looking good.   A few suggestions:

     

    Screenshots shrink when posted, so get difficult to read.  And if a user enlarges them, they tend to get fuzzy.   So you might want to trim them down with Preview or the like to just the window (or important part of the window), so what the user needs to see is clearer and more prominent.

     

    Especially for the second one, while folks don't really need to able to read the Applescript, it would be much clearer.

     

    Adding things like a red circle around the Calendar Alarm in the first sample really draws attention to it.

     

    And you might want to mention in the last paragraph that all those things should or may be there already (at least they were for me!).

     

    Great!

  • 18. Re: (re)Enable iCalendar ability to execute AppleScript
    Pondini Level 8 Level 8 (38,720 points)

    Hi,

     

    I had a few minutes, so took a crack at it myself:  https://discussions.apple.com/docs/DOC-4082

     

    See what you think.  Unlike the normal forums, there's no time limit for edits, so I can make any changes you want.

     

    Thanks!

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

    Looks good. I can see what you were referring to about the screenshots being fuzzy. I had to reduce them from their original size (1280x800) to fit properly into the document I used as the template for my post. I can try to produce clearer screenshots. If I get those done, I will forward them to you. Otherwise, I wouldn't change a thing. Thanks for adding your tweaks in. The past few days have been busy for me.

  • 20. Re: (re)Enable iCalendar ability to execute AppleScript
    Pondini Level 8 Level 8 (38,720 points)

    Great. 

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

    This is the clearest, most concise fix out there at the moment.  In essence it replaces all our custom scripts (written to run in iCal) with ones dedicated to iCal - as far as I can tell.  Thanks for posting.

  • 22. Re: (re)Enable iCalendar ability to execute AppleScript
    autnagrag Level 1 Level 1 (45 points)

    If anyone else gets frustrated with this, I found I had to quit Calendar.app and then relaunch it for each new Calendar_Alarm.app I wanted to attach.

     

    Without this step, the apps I had created would be unselectable/unattachable.

     

    ?????

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

    The simple solution is to just save the script as an application inside Applescript Editor.

    Then choose "Open file" (intstead of the missing "Run script") in the calendar event and select the app you created.

  • 24. Re: (re)Enable iCalendar ability to execute AppleScript
    autnagrag Level 1 Level 1 (45 points)

    Jorsta,

     

    If your posting is to me, what you suggest is exactly what I was doing, and what I describe was the result. The apps I had created in Automator were grayed out/unselectable as targets for a reminder of the "open file" type in the Automator-name calendar in Calendar.app. After quitting Calendar.app and relaunching it, I could, with success, select one of the three apps I had created to be such a target.

     

    Thanks, though.

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

    Well, I haven't read the whole thread here - but I did read the original post.

     

    I just wonder why you have to use Automator at all – when it's applescripts you wan't to execute. Just open your script in the AppleScript Editor, and save as/export it choosing "application" as file format.

     

    Using Automator is an unnecessary step.

  • 26. Re: (re)Enable iCalendar ability to execute AppleScript
    Pondini Level 8 Level 8 (38,720 points)

    Jorsta wrote:

    . . .

    I just wonder why you have to use Automator at all – when it's applescripts you wan't to execute. Just open your script in the AppleScript Editor, and save as/export it choosing "application" as file format.

    That didn't work in the beta versions of Mountain Lion -- you couldn't select an applescript app for the Open File option. 

     

    Now it does (which makes no sense, since they responded to bug reports saying they removed the AppleScript option for "security reasons").

     

    Very odd. 

  • 27. Re: (re)Enable iCalendar ability to execute AppleScript
    autnagrag Level 1 Level 1 (45 points)

    How odd indeed. The reason I looked for this thread, steered here by another forum, was that the "open file" alert in ML was doing that and only that. I would find my unexecuted AppleScriptMy.scpt open. ("Gosh, thanks.")

     

    I can't recall if I tried pointing open file at an AppleScripteMy.app.

     

    It seems now this whole thread hinges on the detail: "If the AppleScript you ran as a 'run script' alert under iCal/Lion won't run under Calendar/Mountain Lion, save it in the .app format from AppleScript editor and then point the 'open script' alert at that."

     

    It is easy to change the .scpt into a .app for an extant script. For me, at least, it was a bit of a struggle to get these Automator Calendar Alerts to work. They do work, but they have little or no elegance.

     

    How dense of me and perhaps others to miss the detail that Apple did not 'refuse' to let an alert run an AppleScript, but did impose a new format requirement on such scripts.

     

    I hope others find this part of this thread before duplicating some or any the efforts exerted by all those who contributed here.

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

    It wouldn't make any sense for Apple to, for "security reasons", stop Applescript apps from being executed by Calendar events – and at the same time allow the same thing for Automator apps (or other apps).

     

    But to exclude compiled scriptfiles does make a sense: The new Gatekeeper choice to only allow downloaded apps from Mac App Store or certified developers would block a harmful app but miss a harmful scriptfile.

  • 29. Re: (re)Enable iCalendar ability to execute AppleScript
    nothin7 Level 1 Level 1 (10 points)

    Thanks LinuxGeek3447!

     

    When I saved the Calendar Alarm in Automator, it was automatically added to my Calendar at the current time.

     

    If anyone else is wondering how to edit their Calendar Alarms, these Automator apps are stored in ~/Library/Workflows/Applications/Calendar. I tried moving the .app file to another folder, and Calendar was no longer able to select it in the event details popup. Seems like it's gotta stay there.