Author Topic: AutoExec script - from command line or elsewhere  (Read 3761 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
AutoExec script - from command line or elsewhere
« 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
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: AutoExec script - from command line or elsewhe
« Reply #1 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 I'm doing it.
All of script handling is coded in the EA Add-in Framework, most of it in the class Script

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

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: AutoExec script - from command line or elsewhe
« Reply #2 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 I'm doing it.
All of script handling is coded in the EA Add-in Framework, most of it in the class Script

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
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: AutoExec script - from command line or elsewhe
« Reply #3 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