Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Paolo F Cantoni on September 11, 2015, 01:19:37 pm

Title: AutoExec script - from command line or elsewhere
Post by: Paolo F Cantoni on September 11, 2015, 01:19:37 pm
Is there any way to start EA and get it to execute a pre-defined script?
I'd like to be able to nominate the script, but I'll settle for Autoexec if available.

From what I can see, there's no way to run a script through the API either.  Is that the case?

TIA,
Paolo
Title: Re: AutoExec script - from command line or elsewhe
Post by: Geert Bellekens on September 11, 2015, 02:23:23 pm
Hi Paolo,

There's indeed no operation in the API to run a script, but it can be done.

With my EA-Matic (http://bellekens.com/ea-matic/) I'm doing it.
All of script handling is coded in the EA Add-in Framework (https://github.com/GeertBellekens/Enterprise-Architect-Add-in-Framework), most of it in the class Script (https://github.com/GeertBellekens/Enterprise-Architect-Add-in-Framework/blob/master/EAAddinFramework/EASpecific/Script.cs)

With the EA-Matic add-in you can attach scripts to API events such as EA_FileOpen. Those scripts will then be executed just like an add-in operation would.

Geert
Title: Re: AutoExec script - from command line or elsewhe
Post by: Paolo F Cantoni on September 11, 2015, 05:57:29 pm
Quote
Hi Paolo,

There's indeed no operation in the API to run a script, but it can be done.

With my EA-Matic (http://bellekens.com/ea-matic/) I'm doing it.
All of script handling is coded in the EA Add-in Framework (https://github.com/GeertBellekens/Enterprise-Architect-Add-in-Framework), most of it in the class Script (https://github.com/GeertBellekens/Enterprise-Architect-Add-in-Framework/blob/master/EAAddinFramework/EASpecific/Script.cs)

With the EA-Matic add-in you can attach scripts to API events such as EA_FileOpen. Those scripts will then be executed just like an add-in operation would.

Geert
Cool, I'll see if my management is happy with that.

Can I interrogate the command line args with EA-Matic?  Then I could get EA to execute a specific script (or not) on file open from the command line.

Paolo
Title: Re: AutoExec script - from command line or elsewhe
Post by: Geert Bellekens on September 11, 2015, 06:12:37 pm
Quote
Can I interrogate the command line args with EA-Matic?  Then I could get EA to execute a specific script (or not) on file open from the command line.

Not with something specific to EA-Matic. Do you know if those command line args are available to an add-in?
If they are you might be able to get to them from within a script as well.

Geert