[JS] Remove menu on quit?
i have script creates new menu item in main menu menu items. after restarting menu still there empty.
im looking way ro remove menu completley, ive understood there no event quit.
how do this?
in cs5, it's pretty easy:
if create menu:
var testmenu = app.menus.item("$id/main").submenus.add("test");
you can add event listener application close menu on quitting:
var elcleanup = app.eventlisteners.add("beforequit", function() { testmenu.remove(); })
i don't think beforequit avalable in ealier versions, i'm not sure best way take care of pre-cs5.
i guess add startup script along lines of:
try{ app.menus.item("$id/main").submenus.item("test").remove(); } catch(e){}
which try remove menu every time indesign starts up.
More discussions in InDesign Scripting
adobe
Comments
Post a Comment