Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Why does this AppleScript cause a big delay in Mavericks?

Hello,


I use FileMaker for my database needs. I have been using an AppleScript to create a calendar event from FM to my Calendar using Apple Calendar. This has worked flawlewssly in Mac oSX 10.7 and 10.8. Every since Mavericks, the script still works (creating no error) but takes about 1 minute to complete. The funny thing is that if I run the script from the AS editor, it works just fine. The FileMaker does have access to my calendar in the security area.


Any thoughts?


Here is the script that is invoked:


launchapplication "Calendar"


repeat until application "Calendar" exists

"delay 1"

end repeat


tell application "Calendar"

set my_event to make new event at end of events of calendar "Test Calendar" with properties {description:"Test description here", summary:"Summary Text here", location:"location information here", start date:date "Sunday, December 8, 2013 at 10:00:00 AM", end date:date "Sunday, December 8, 2013 at 12:00:00 PM", allday event:false}

end tell



Thanks!

Stephen

MacBook Pro, OS X Mavericks (10.9)

Posted on Dec 13, 2013 9:52 AM

Reply
14 replies

Dec 17, 2013 1:50 AM in response to El Gaucho

Hello


I don't think you need the first four lines of code at all:


launch application "Calendar"
repeat until application "Calendar" exists
    "delay 1"
end repeat


Or, if they are really necessary for some reason I don't know, they should have been at least as follows:


launch application "Calendar"
repeat until application "Calendar" is running
    delay 1
end repeat


Note that it uses no quotes around delay statement and uses application's running property in lieu of exists command. The exists command with an application object as its direct parameter will implicitly launch the application in order to send the "exists" message to the application, which I don't think is what you intend here.


Regards,

H

Dec 17, 2013 5:57 AM in response to Hiroto

Thanks, I did modify this and the aplescript works as planned. However, the issue that I am facing is that when I run this AppleScript from within my FileMaker application, it works perfectly and quickly. No issues. FileMaker allows me to create a Runtime version of the software. When I use the Runtime version with the same database and AppleSCript, I get this long delay and spike in the "tccd" process in Activity Monitor. This is where I can't find an answer. The Runtime does have permission to access the Calendar application so I am completely stuck. This leads me to believe that it is more of a FileMaker Runtime issue in Mavericks than with AppleScript since this worked just fine under 10.8.x.


Any other thoughts or considerations?

Dec 17, 2013 7:38 AM in response to El Gaucho

Hello


It seems tccd daemon is doing something about tccd.db which keeps track of applications allowed to access contacts database.


See these links for some information:


What the **** is TCCD?

https://discussions.apple.com/thread/4165543


Mac Operations

http://macops.ca/modifying-the-tcc-db/


I don't use 10.7 or later systems and so cannot be of any help here.


Regards,

H

Jan 7, 2014 9:32 AM in response to _Ÿ_

Hello.


I am using iCloud calendars and my results have been mixed. I am now calling the calling script via a shell script terminal command to see if that would help. So far it has been working better but not ideally. Before the applescript would run instantly, now it's dropped from the 1 minute time frame to about 10 seconds to almost 5 seconds. But again my results have been mixed.


Not sure if that hehlps. I wish I had more info from FileMaker on this.

Why does this AppleScript cause a big delay in Mavericks?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.