Page 1 of 1

Embedded AppleScript vs. External File AppleScript

PostPosted: Tue Oct 21, 2008 7:50 pm
by anode
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)

Re: compile benny?

PostPosted: Tue Oct 21, 2008 8:08 pm
by matt (support)
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

PostPosted: Tue Oct 21, 2008 8:19 pm
by anode
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)

Re: Embedded AppleScript vs. External File AppleScript

PostPosted: Fri Sep 02, 2016 4:05 pm
by ryanbuckner
IS there an easy way to create small Applescripts and place them in a directory so functions can be reused?

Re: Embedded AppleScript vs. External File AppleScript

PostPosted: Sat Sep 03, 2016 10:05 am
by ryanbuckner
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.

Re: Embedded AppleScript vs. External File AppleScript

PostPosted: Sat Sep 03, 2016 9:53 pm
by matt (support)
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.

Re: Embedded AppleScript vs. External File AppleScript

PostPosted: Mon Sep 05, 2016 7:12 am
by ryanbuckner
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?

Re: Embedded AppleScript vs. External File AppleScript

PostPosted: Mon Sep 05, 2016 10:31 am
by matt (support)
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.