CustomUI

 From:  mkdm
6507.246 In reply to 6507.245 
Hello Michael!

I'm not Max but I write here my thoughts about your questions :)


1) "what should the directory containing scripts to execute at startup be called, maybe just plain "startup" ? I guess there should also be a "commands" and "scripts" directory that you could make there as well."

I would call it "autostart"

2) "But then will having MoI look in 2 different commands directories for things cause problems since currently there's only one that is identified by moi.filesystem.getCommandsDir() ? And what should happen if there is a file with the same name in both places, which one should be actually loaded?"

I would make another API called "moi.filesystem.getAlternativeCommandsDir()"
If there is a command with the same name in both places I think that the priority should go to the "standard" command folder,
or you could use a sort of "prefix" to force a command to be searched into a specific path.
For example "#something" could be used to execute the "something" command contained into the AppData "commands" or "scripts" folders,
while simply writing "something" will run the command from the standard location.

3) "Also when should startup scripts run - probably just before the main window is shown?"

Hmm....I think that startup scripts should run just immediately after that all the UI objects are accessible, just like the "document ready" of standard JavaScript or jQuery.


Ciao!

- Marco (mkdm)