IDEScript capabilities?

I Have not done anything with IDE scripts… I quickly looked at the docs but it’s not obvious to me if I can create one to do what i want:

Can an IDE script run a precompiled Xojo app I create, passing it some information and somehow get information back from that App?

What I have in mind… Right now If one works in R2+ and one wants to retain backwards compatibility the project needs to have been created in <2019R2 and you can not do a "Save As " and retain compatibility.

Yes one can have created a project in R1 or lower (or copy an existing one manually out side of Xojo and rename it) and then open it in R2, and if you to fork it Copy and rename it manually to…

But that is a pain and I don’t know if Xojo Inc will decide to allow saving backwards compatible projects in future versions…

What i was thinking about was to adding two Commands to Xojo via IDE scripts if possible…

  1. New API 1 Project
    this would copy and API 1 template project and rename it via the app it calls, allow me specify an new name and return the path so the IDE script can open it
  2. Save As API 1 project
    Of course this could only work a project that as API 1 to start with… Not ideal but better than nothing. The IDE script would save the project and then cal the appeasing the project path. The App would allow me to supply a new name , duplicate the file, rename it to that, Pass that path to the IDE which then close the original and opens the the copy

So Can IDe scripts do this?


  • karen

Yes. You’d have to get into shell calls for some of it, but don’t see a problem with the rest.


I figured the App would need to get launched from a Shell so it could Pass info back, but I did not know if an IDE Script could shell out!

It can, and it’s quite handy.

I have never done it and can’t test it until later this evening, but I was wondering, when launched from a shell by the IDE Script, can a GUI App Write to StdOut.Write or use Print to return data to the IDE Script?

That should work with a console app but I don’t know if GUI apps can do that…

The Language Ref says for StdOut says:

“Retrieves the global reference to the standard output stream in ConsoleApplications, which is typically the terminal window.”

For Print it says:
“Used to print to the terminal in ConsoleApplications.”

and I need to use a GUI App…

If not I would need a console app that calls a GUI App and they communicate via IPC or something … and that is starting to get ridiculous! :wink:

  • Karen

[quote=463297:@Karen Atkocius]f not I would need a console app that calls a GUI App and they communicate via IPC or something … and that is starting to get ridiculous! :wink:

Looking into it more, it is doable… but it looks like if I want to do it, that is the way I will have to, unless someone knows of another way.

When i get done with my current project i will give it a try. If I am going to work in R2+ IDE’s i need a way of doing a convenient backwards compatible “Save as” on projects that are not using API 2 property names…

While it sure looks like Xojo Inc strongly wants us to move to R2+ and API 2 (probably due to low adoption of the Xojo.framework), I (and I suspect more than a few others) are not ready to commit even all new code to be R2+ only… So IMO R2+ should allow us to Save or “Save As” in a format compatible with <2019R2 if they want more people to use the new IDE versions.

As mentioned above i think I could add that myself (albeit kludgy) … but it really should be built into the IDE.

it would also be nice to have a toggle (keyboard and/or menu item) to switch Autocomplete between either API 1, API 2 or both on demand while coding.