Embedded AppleScript vs. External File AppleScript

Posted on
Tue Oct 21, 2008 7:50 pm
anode offline
Posts: 697
Joined: May 27, 2007
Location: NC

Embedded AppleScript vs. External File AppleScript

Any reason to use the embedded apple script over a seperate file? I can see separate for ease of getting to it if Indigo for some odd reason crashes.

But embedded offers ease of maintenance from a system level approach.

(Its nice to have choices!)

But main Q is, any reason to compile an embedded script? Speed can't be that much better (coms will slow it down anyways)

Posted on
Tue Oct 21, 2008 8:08 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: compile benny?

For small AppleScripts that do not depend on communicating with other applications or network connectivity, I recommend embedded. Non-embedded scripts have the advantage of being run in their own process by Indigo.

This becomes a very big advantage if the AppleScript hangs waiting for a response from an application (ex: iTunes if a modal dialog is open) or a network response (NOAA sync script). If those script were run embedded, then there is the potential the entire Indigo Server will hang while the script waits. But if you run it non-embedded then Indigo Server can keep on processing.

Regards,
Matt

Posted on
Tue Oct 21, 2008 8:19 pm
anode offline
Posts: 697
Joined: May 27, 2007
Location: NC

(No subject)

Good stuff! With me away at up to 2 weeks at a clip, less hangs the better. Good guide line.

Thanks.
(great program too. Love the fully scriptable aspect)

Posted on
Fri Sep 02, 2016 4:05 pm
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Embedded AppleScript vs. External File AppleScript

IS there an easy way to create small Applescripts and place them in a directory so functions can be reused?

Posted on
Sat Sep 03, 2016 10:05 am
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Embedded AppleScript vs. External File AppleScript

ryanbuckner wrote:
IS there an easy way to create small Applescripts and place them in a directory so functions can be reused?


I think I just found the answer from the ApplseScript help pages here. This will do it, right?

And, other people can create attachment scripts and share them via the user contribution library - there are already quite a few there. Scripts that are placed in the /Library/Application Support/Perceptive Automation/Indigo 5/Scripts/Attachments/ folder will automatically be loaded when the IndigoServer starts up.

Posted on
Sat Sep 03, 2016 9:53 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Embedded AppleScript vs. External File AppleScript

Yes, that is exactly what the attachment AppleScripts are for (shared scripting functions).

We highly recommend using Python over AppleScript – it is more reliable and we will be adding more APIs to it in the future.

Image

Posted on
Mon Sep 05, 2016 7:12 am
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Embedded AppleScript vs. External File AppleScript

As I switch over and learn Python, can you give me a quick example of where to place the function and how to , I guess import it into the Embedded script to run?

Posted on
Mon Sep 05, 2016 10:31 am
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Embedded AppleScript vs. External File AppleScript

This tutorial is the best place to start. Read over the entire page for a good overview, but there is a section on that page that talks about sharing classes/methods across scripts.

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 7 guests

cron