A quick (and dirty) Script Palette script

 From:  dinos
5993.1 
I know that Michael is working on a proper solution, but i had some free time a few weeks ago and decided to have a go at a simple Script Palette.
I find it useful for all those scripts that are good to have, but don't use often enough to remember their shortcuts.
I meant to improve it a bit but i didn't have much time available, so here it is.

Please note that i'm reading the shortcuts & scripts definitions from the moi.ini file, so after you choose the commands you want to add to the palette you MUST quit and relaunch Moi before they appear in the palette.
This is a major limitation, but i cant see a way around it at the moment. Perhaps Michael can point me in the right direction.


Installation.
Copy the file ScriptPalette.htm from the zip into your ui folder.

Then create a shortcut (i used Z):
code:
script:moi.ui.createDialog( 'moi://ui/ScriptPalette.htm' );


Usage.
It works with both scripts in the commands folder and inline scripts.
To make a script appear in the palette you have to modify it in Options/Shortcut Keys and edit it to include a comment beginning with an !

So if /*Script Comment*/ is edited to /*!Script Comment*/ then a command with the name "Script Comment" will appear in the palette.
The comment can be anywhere in the script.

For example (inline script):
code:
Shift+I | script: /*Isolate selection */ moi.geometryDatabase.isolate();

must be edited to:
code:
Shift+I | script: /*!Isolate selection */ moi.geometryDatabase.isolate();



or if its a command in the commands folder:
code:
Shift+U | UnwrapCurve  /*Unwrap Curve*/

it must be edited to:
code:
Shift+U | UnwrapCurve  /*!Unwrap Curve*/




Then quit Moi, relaunch and press Z (or whatever shortcut you used).


I've updated the script to automatically close the popup window after a command is selected. (ScriptPalette.htm.zip)



The original version with the close button is still available (ScriptPalette_Close.zip)





I hope you find it useful.
Please post any bugs you find.

Dinos

EDITED: 6 Feb 2014 by DINOS