Ahh in the scripts menu, well you could use:
jscript code:
function OnGetScriptMenu(Location)
{
var scriptmenu = "<ScriptMenu>";
scriptmenu += "<MenuEntry Id=\"[ID]\">[Text]</MenuEntry>";
scriptmenu += "<MenuEntry Id=\"[ID2]\">[Text2]</MenuEntry>";
scriptmenu += "<Separator/>";
scriptmenu += "<MenuEntry Id=\"[ID3]\">[Text3]</MenuEntry>";
scriptmenu += "</ScriptMenu>";
//a blackslash infront of a " is invisable in the outcome but will forecome " ending the string.
}
fill in the ID it should return when clicked at [ID] and the text it should show at [Text].
Ofcourse removing the square brackets.
also you can use <Separator/> between Menu Entries to add a line between those entries.
The event called when the menu is clicked will be:
jscript code:
function OnEvent_MenuClicked(MenuItemId, Location, OriginWnd)
{
}
You could fill in like:
jscript code:
function OnEvent_MenuClicked(MenuItemId, Location, OriginWnd)
{
switch (MenuItemId)
{
case "[ID]":
MsgPlus.DisplayToast("Title", "That tickles!");
break;
}
}
Now we have a complete working script!
Ofcourse what it does IS pointless and it's NOT gunna turn you in to an ugly rat. Alltough if it does you should definately PM me O_o
jscript code:
/*****************************\
| Warning! |
| Reading the following |
| script will turn you |
| in to a big ugly rat! |
\*****************************/
function OnGetScriptMenu(Location)
{
var scriptmenu = "<ScriptMenu>";
scriptmenu += "<MenuEntry Id=\"[ID]\">[Text]</MenuEntry>";
scriptmenu += "<MenuEntry Id=\"[ID2]\">[Text2]</MenuEntry>";
scriptmenu += "<Separator/>";
scriptmenu += "<MenuEntry Id=\"[ID3]\">[Text3]</MenuEntry>";
scriptmenu += "</ScriptMenu>";
}
function OnEvent_MenuClicked(MenuItemId, Location, OriginWnd)
{
switch (MenuItemId)
{
case "[ID]":
MsgPlus.DisplayToast("Title", "That tickles!");
break;
case "[ID2]":
MsgPlus.DisplayToast("Title", "You just had to try 2 huh?");
break;
case "[ID3]":
MsgPlus.DisplayToast("Title", "Ok jokes over >:l");
break;
}
}
This is just simple, you could ofcourse make it check if you have clicked ID1 before and THAN give 2 and so on, but that is not what this example is about. (trying to keep it simple
)
And you could use xml to make like a nice preference window.
For that you could use
Interface Writer, it is easy to make a pretty nice interface.
edit:
quote:
Originally posted by Yustme
Just to create one, not how to catch events and clicks etc. I'll figure that one out myself.
Couldn't help myself
Edit2:
Humz, changed the first part, adding them one by one just looks so cute
Alltough again mattys script is much more complicated and probably more helpfull...