Hi all,
I've written an HTA that emulates a tabbed browsing interface. What I'd like to do, if possible, is replace that with this wonderful menu system. So, what I need to know is how to call my VBscript Subs/Functions from the menu items. I've seen one answer that says the menu item should just say aI("text=doFunction;url=javascript:myfunction();");
However, all this does is open an IE page that tries to go to the page javascript:myfunction(), it doesn't run the Vbscript code in the HTA.
For example, I have one function that reboots a remote machine (let's called it RemReboot). What do I need to specify in the menu_data.js file to make it call the RemReboot Vbscript function in the HTA?
Using the menu system with an HTA and VBScript - [SOLVED]
No problem. Now all I need to find out is how to make entries in the menu dynamic.
My HTA is used to get info on remote PCs and one of the things it retrieves is a list of shares available on the machine. Currently those shares are added to an HTML listbox from which the user selects which share to browse/manage. It would be nice to have a menu entry that is dynamically created with the various shares. I think that might be a little beyond my very limited JSscript skills though
My HTA is used to get info on remote PCs and one of the things it retrieves is a list of shares available on the machine. Currently those shares are added to an HTML listbox from which the user selects which share to browse/manage. It would be nice to have a menu entry that is dynamically created with the various shares. I think that might be a little beyond my very limited JSscript skills though

Hi,
There is a menu editing API at http://milonic.com/mm_menueditapi.js that will allow you to dynamically change menus and menu items.
-- Andy
There is a menu editing API at http://milonic.com/mm_menueditapi.js that will allow you to dynamically change menus and menu items.
-- Andy
Excuse my newbie ignorance but how do you incoporate this into a simple HTA? For example, here's a test one I have.
<HTA:APPLICATION
SCROLL="yes"
SINGLEINSTANCE="yes"
WINDOWSTATE="normal">
</head>
<Body>
<script type="text/javascript" src="milonic_src.js"></script>
<div class=milonic><a href="http://milonic.com/">JavaScript Menu, DHTML Menu Powered By Milonic</a></div>
<script type="text/javascript">
if(ns4)_d.write("<scr"+"ipt type=text/javascript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt type=text/javascript src=mmenudom.js><\/scr"+"ipt>"); </script>
<script type="text/javascript" src="menu_data2.js"></script>
</body>
<script language="VBScript">
Sub HELLOWORLD
MsgBox "HELLO WORLD"
End Sub
</script>
</html>
Let's say I have another Sub that goes off and gets all the open shares on a machine. How can I have the API add a menu item for each share?
I hope I've explained that correctly.
<HTA:APPLICATION
SCROLL="yes"
SINGLEINSTANCE="yes"
WINDOWSTATE="normal">
</head>
<Body>
<script type="text/javascript" src="milonic_src.js"></script>
<div class=milonic><a href="http://milonic.com/">JavaScript Menu, DHTML Menu Powered By Milonic</a></div>
<script type="text/javascript">
if(ns4)_d.write("<scr"+"ipt type=text/javascript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt type=text/javascript src=mmenudom.js><\/scr"+"ipt>"); </script>
<script type="text/javascript" src="menu_data2.js"></script>
</body>
<script language="VBScript">
Sub HELLOWORLD
MsgBox "HELLO WORLD"
End Sub
</script>
</html>
Let's say I have another Sub that goes off and gets all the open shares on a machine. How can I have the API add a menu item for each share?
I hope I've explained that correctly.