Construction line script

 From:  Alomphega
1029.31 In reply to 1029.30 
Hi Michael,

> So you should avoid doing some parts of the instructions [...] unless you are familiar with editing HTML.

Well, in fact I am a bit familiar with editing and text-editing the HTML code and I can do that without hurt the code, but of course I prefer to avoid it if I can, especially when I do not know the logical inside.

> Instead of trying to add a button the more usual way of calling a plug-in for now is to set up a shortcut key for the plug-in and run it by pushing whatever key you assign to the shortcut.

By "calling a plug-in" and "to set up a shortcut key for the plug-in" do you mean than, for instance with your "ConstructionLin3.zip" script, we just have to put both the .htm and .js in the MoI "./commands" directory and then "ConstructionLine.js" and "ConstructionLine.htm" are seen like plug-in by MoI and can just to be called by their root name - as "ConstructionLine" - just written as this in the "Command" section of one new shortcut created in the Shortcuts key section of the options ?

Or do we have to do anything else ?

In fact of course I have tried what I supposed above, and I found that if I choose "L" as shortcut key for instance, when I press "L" a panel "Drag to create construction lines" appears with "clear", "done" and "cancel" buttons which are quite simple to understand, but maybe I have missed something ?

> In the future I do want to make it easier to set up some UI for plug-ins, something like a special plug-in menu or something like that.

Sure it will be very easier, but for now it miss just a written method to deal with that because I have searched and found nothing nowhere... Maybe there is something but sure it is too hard to find for me.

So I suggest you to put something like that after "Scripting" title on the "Resources" page of the MoI website just to avoid many questions :
--8<--
To install a "ScriptName" script just unzip the zipped script "ScriptName.htm" and "ScriptName.js" files, put them in the "commands" directory of the MoI installation the re-start MoI.
To run this "ScriptName" script create a new shortcut with a new key of your choice in MoI options with "ScriptName" written in the "Command" line. Using this shortcut will run the script.
--8<--

Please if I am wrong tell me what I have missed !

Cordially,
Guy

_____________________________________________________________________________________
always working on few funny projects : www.nauticaerium.com ; www.conceptarum.com and so on...