View unanswered posts | View active topics It is currently Wed Jun 19, 2013 1:49 pm



Reply to topic  [ 5 posts ] 
 Execute Applescript is slow by 10 seconds... 
Author Message
User avatar

Joined: May 10, 2010
Posts: 67
Post Execute Applescript is slow by 10 seconds...
Hello All,

Can someone please help with an issue I am having in 4.19 Pro.
I have created a few triggers to execute an applescript (play a mp3 file) when a door is open.
When a door is open I want to hear "front door is open". The script gets executed but it is delayed by nearly 10 seconds.

I have not setup any delays, could this be a hick-up in the computer?
A restart of the computer doesn't change anything.
A restart of Indigo doesn't change anything.

In the Execute Applescript window I have located the correct script file to play the correct mp3 file.
Would it make a difference to embed the content of the script instead?

T.I.A.


Wed Nov 02, 2011 10:52 pm
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6856
Location: Austin, Texas
Post Re: Execute Applescript is slow by 10 seconds...
Can you post the script itself (insode a code block)?

_________________
Jay (Indigo Support)
Image


Thu Nov 03, 2011 8:10 am
Profile WWW
User avatar

Joined: May 10, 2010
Posts: 67
Post Re: Execute Applescript is slow by 10 seconds...
[/code]Hello Jay,

How would I post the requested script inside a code block?


-------------------------------------------------

Code: Select all
tell application "Finder"
   activate
   open document file "Front door is open.mp3" of folder "GhostReader" of folder "Desktop" of folder "it" of folder "Users" of startup disk using application file "Play Sound.app" of folder "Desktop" of folder "it" of folder "Users" of startup disk
end tell

-------------------------------------------------


Thu Nov 03, 2011 10:07 am
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6856
Location: Austin, Texas
Post Re: Execute Applescript is slow by 10 seconds...
Edited your post to show how to use code blocks (it's the button labeled "Code" when you're editing your post).

Anyway, it looks like it should just open. You could also tell the Play Sound app to play the file directly (rather than going through the Finder). That should save some time but I'm not sure it's the reason for the entire delay. Check out the scripting dictionary for the Play Sound application in Script Editor for details. You could then just embed that script - not however that there is only a tiny bit of overhead for the server to launch the script separately than what's needed to run the script internally so that really shouldn't make any perceptible difference.

_________________
Jay (Indigo Support)
Image


Thu Nov 03, 2011 10:20 am
Profile WWW
User avatar

Joined: May 10, 2010
Posts: 67
Post Re: Execute Applescript is slow by 10 seconds...
Thank you Jay!

I feel like I am back on track :D


Thu Nov 03, 2011 10:26 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.   Template designed by STSoftware.