Hi hl,
re:
> Can you help me design a script:? I can press the shortcut key to open shortcut menu and press it again to close shortcut menu.Thanks!
Or another method that could work would be to store the dialog object that is returned from moi.ui.createDialog() in a centralized place so it can check if it has been set on a previous script run. When the dialog closes some additional script in the dialog box page can clear that value.
So to do that, inside SidePane1.htm modify the <body> tag to have an onunload="" handler like this:
code:
<body class="SidePaneBody" onunload="moi.command.setOption( 'SidePane1_dlg', null );">
That will handle clearing out the value when the dialog box has been closed.
Then the shortcut could be set up like this:
script: var dlg = null; try { dlg = moi.command.getOption( 'SidePane1_dlg' ); } catch(e){} if ( dlg != null ) { dlg.window.close(); } else { dlg = moi.ui.createDialog( 'SidePane1.htm' ); moi.command.setOption( 'SidePane1_dlg', dlg ); }
- Michael
|