CustomUI

 From:  Michael Gibson
6507.67 In reply to 6507.66 
Hi Burr,

> I altered Max's plug to also grab my inline scripts from MoI's Scripts folder, and also did some
> experiments with generating some extra sub folders in there too. Max's plug will actually grab
> them from my "my documents" folder if I direct it to.

The only thing to be aware of with other directories is that if the name that is eventually set as the command="" attribute on the does not have a full path on it, like if it's just the plain command name itself, MoI will only find it if it's under the commands or scripts folders. So if you want to put a script somewhere else other than under scripts you can do that but the thing that eventually gets passed to moi.command.execCommand() should be have the full path and file extension on it and not just the plain name.


> So I guess I was just wondering if they run in the context they would normally be
> run as if MoI was running them with it's default behavior..

Yeah, if you haven't modified anything else in that, it looks like it extracts just the plain name and that goes into a command="" attribute on a menu item and so whatever's in there will get passed to moi.command.execCommand() - it will behave the same as if you put that same thing into a keyboard shortcut or typed-in command name. If it finds a matching file of that name inside the commands folder, it will run it as a command. It will also check in the scripts folder, if it finds it there it will load that file and run it as an inline script. If it was passed in a full path it loads it and runs it as inline script. If instead of a file name it starts with "script:" then that text is itself run as inline script instead of being taken as a file name to load, this is all the same as what you get for keyboard shortcuts.

Hope this helps...

- Michael