There is now a beta of Indigo 1.1 that has improvements to the way script attachment plug-ins are managed. The beta can be downloaded at:
http://www.perceptiveautomation.com/ind ... o_beta.dmg
-- Important -- this is a beta, so be sure and back up your database (.indiDb) file before you use it. It seems pretty stable but not many folks have had their hands on it yet. There are some features and UI that are not functional yet, but they shouldn't cause too many problems. Those new features/UI will not work in this build.
The changes to the attachment plug-in model should be backwards compatible with the previous model.
Improvements:
Scripts in the _Attachments_ folder no longer have to be script applications. In fact, you will likely have better performance and fewer problems if you save your attachment plug-in scripts as type "Compiled Script". Existing script applications will continue to work but the limitations / problems with script applications will not be fixed. Use compiled scripts instead to avoid these issues.
All script attachments now share the same global context as Indigo. This means you can directly call AppleScript handlers (subroutines) defined in attachment scripts from an embedded Indigo script. You can also call directly back into Indigo from script attachments. For example, the following will work:
Embedded Indigo Script (inside a trigger or time/date action):
log "about to call plug-in script"
testFunc("isDaylight")
log "returned from plug-in script"
Attachment plug-in script (saved as a Compiled Script inside the Scripts/Attachments/ folder):
using terms from application "Indigo"
on testFunc(varName)
log "var name is " & varName
log "var value is " & (value of variable varName)
log "next sunset is " & (calculate sunset as string)
end testFunc
end using terms from
Note you do still need to use the "using terms from" phrase so that the script can compile, but no "tell app" to Indigo is needed. If you make changes to an attachment script, then you can choose "Reload Attachments" from the script menu to automatically reload those scripts into Indigo's global context.
Let me know if you have any problems!
regards,
matt