What happens to events while in an applescript?

Posted on
Sun Jul 18, 2010 7:17 pm
anothersphere offline
Posts: 153
Joined: Jul 01, 2009

What happens to events while in an applescript?

Hi,

I am running ping in the shell via applescript, to identify if a certain device is alive.
This takes time. I have limited it with the -t option to stop it taking for-ever.
However, it still takes some seconds to run (I have limited to 4 seconds).

Question: What happens to other indigo events while an applescript runs - do they get queued or ignored?
Particularly when shell commands are called.

Until I added the -t option to my ping, I was seeing some weird happenings with some events.

I have seen an alternate note that suggests implementing my script outside Indigo and telling Indigo the result.
I would like to avoid having to chron etc as it somewhat obfuscates my setup as well makes remote admin slightly more complex.

Thanks

Martin Miller

Auckland - New Zealand

Posted on
Sun Jul 18, 2010 7:23 pm
matt (support) offline
Site Admin
User avatar
Posts: 19368
Joined: Jan 27, 2003
Location: Texas

Re: What happens to events while in an applescript?

Indigo actions that use embedded AppleScripts (scripts written or pasted directly into the edit field in the action panel) run in the main Indigo Server thread. There are other threads that handle queuing incoming commands, sending / receiving email, etc. Nothing should be lost, but holding up the main Indigo Server thread isn't a good idea.

Instead I would recommend that you use the Apple Script Editor application and save your script as an external script file. You can then still run that from Indigo as an action, but in that case Indigo will start a new process to run the AppleScript.

Image

Posted on
Sun Jul 18, 2010 7:41 pm
anothersphere offline
Posts: 153
Joined: Jul 01, 2009

Re: What happens to events while in an applescript?

Can you pass parameters to an external script in this way?
I can make the applescript into an external script, but if I cant do parameters, I will have to make some little scripts each with the required parameter calls.
In my case my script is running for a max of 8 seconds very 10 minutes.

Martin Miller

Auckland - New Zealand

Posted on
Tue Jul 20, 2010 9:47 am
matt (support) offline
Site Admin
User avatar
Posts: 19368
Joined: Jan 27, 2003
Location: Texas

Re: What happens to events while in an applescript?

Yes, but you have to save your scripts as standalone applications in the script editor (not just script files).

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest