IDE scripting: How to manage folders?


I’m writing an IDE automation tool, making use of IDE scripting
I can create classes and folders etc via the DoCommand command. But how can I manage the classes and folders? For example, instead of NewClass, create a newclass in folder x. Or create all classes via the NewClass, and than move them into the right folders?
This would really help me, as IDE automation is nice, but if the dragging and dropping all has to be manually done, it kinda breaks the spirit of my tool!

Thanks a lot for insights.

Edit: I tried selecting the projectitem, but was not succesful, this was my code:

DoCommand "NewFolder" PropertyValue("Folder1.Name") = "UpperFolder" Dim selected As Boolean = SelectProjectItem("UpperFolder") DoCommand "NewFolder" PropertyValue("Folder1.Name") = "Childfolder1" DoCommand "NewFolder" PropertyValue("Folder1.Name") = "ChildFolder2"

I hoped upperfolder would be selected, and the new folders would be appended to upperfolder. But they’re appended to the main project, not the folder called “upperfolder”

Edit, it seems that classes and other ‘upper level’ objects cannot be added to other objects (mainly folders).
Cutting and pasting the selectedobjects isn’t possible also. So I guess there is no real solution for this.

Does anyone knows if there is a feedback case for this? I cannot find one, but don’t want to create doubles.

If somebody still would have some genius inspiration about my problem, please collaborate :slight_smile:


Last and final edit: There is a feedback case similar to what I want: feedback://showreport?report_id=33238

The editor should be able to differentiate between NewClass and InsertClass for example. The feedback case was filed in early 2014, so if somebody wants to support this, go ahead!

Perhaps it would be better if you explained what you’re trying to automate… not just “create a folder and put a class in it,” but why you need this?

Thanks for your answer @Greg O’Lone!
I’m creating a tool that makes programming against a database automated.
So you have a database to start from, fill in some details in my app, it generates IDE script that generates classes, databaseconnections etc.
I try to mimic Entity Framework in .Net. So as a programmer, your programming against Xojo classes, no SQL is needed as that is all auto-generated. My app is now called Xentity Framework.
It is somewhat comparable with Argen, altough it’s quite different.

I had 2 options:

  1. Generating a Xojo project like Argen does.
  2. Generating an IDE script.

I choose the latter because it’s easier to add to an existing project and there is no chance of you guys changing your xmlformat and me needing to rewrite everything for those changes.

So I wanted to generate a folder ‘XentityFrameworkFolder’ e.g. that contains everything my app generates. If the database updates, a user could easily delete the old folder, and let a new script generate a new one.

It’s not a huge deal, but it would be cleaner if the ‘insert’ commands would also exist next to ‘new’. Now all classes and folders and modules are generated in the main project, and have to manually drag the classes in the ClassesFolder, All modules in the ModulesFolder, all CollectionClasses in the CollectionClassesFolder and all those folders in the XentityFrameworkFolder.

At this time this is project for aiding myself. I am willing to maybe release it in the future, but that’s a bit harder with al that manual work.

If you have insights in how to automate the process even more, please tell them.

I’d generate XML or plaint text files / classes and drag them into a project
There simply are things you won’t be able to create via IDE scripting that I would expect will be necessary
Heck I wrote code to do almost exactly this, although it mimicked EOF, in 2005/2006 and those classes still work & can be used to generate code that still load today.

IDE scripting was never designed or intended to do a lot of what people try to use it for, like this, and making it do this would basically require rewriting it. And thats not a high priority.

This case I filed is relevant feedback://showreport?report_id=16236

I made a separate App to deal with all automation processes like the database, the tables and fields.
communicating with xojo using copy/paste or xml files.
it’s easier to deal with once the main app gets more complicated.