Sub Menu Creation

Dear All,
Please see below the source code. It is working fine, but I want to add one sub menu in "Window" or in any default menu supported by InDesign.
var myMe = app.menus.item("$ID/Main").submenus.add("Test");
myMe.remove();
var mySSA= app.scriptMenuActions.add("123");
var mySSM = app.menus.item("$ID/Main").submenus.add("Test");
var myEL = mySSA.eventListeners.add("onInvoke", function(){
      subs();
function subs()
      alert("Selction is: ",  "Test");
var mySSM = mySSM.menuItems.add(mySSA);
Regards,
Rajeev

Modified from the javascript examples:
#targetengine "session"
//MakeScriptMenuAction.jsx
//An InDesign CS3 JavaScript
//Adds a menu at the end of the main menu bar.
var mySampleScriptAction = app.scriptMenuActions.add("Display Alert");
var myEventListener = mySampleScriptAction.eventListeners.add("onInvoke", myFunction, false);
//If the submenu "Script Menu Action" does not already exist, create it.
//You might have to force InDesign to redraw the menu (by switching
//out of the application and back again) to make the menu item appear.
try{
    var mySampleScriptMenu = app.menus.item("$ID/Main").submenus.item("Window").submenus.item("Script Menu Action");
    mySampleScriptMenu.title;
catch (myError){
    var mySampleScriptMenu = app.menus.item("$ID/Main").submenus.item("Window").submenus.add("Script Menu Action");
var mySampleScriptMenuItem = mySampleScriptMenu.menuItems.add(mySampleScriptAction);
function myFunction(){
    alert("This menu item was added by a script.");
And to clean up again:
#targetengine "session"
app.scriptMenuActions.everyItem().remove();
try{
    var mySampleScriptMenu = app.menus.item("$ID/Main").submenus.item("Window").submenus.item("Script Menu Action");
    mySampleScriptMenu.remove();
catch (myError){
    alert("Could not remove menu");

Similar Messages

  • Sub-menu creation for Chapters

    Hi,
    I have made a film and I have added chapters to the film using the software SimpleMovieX. When I tried to add the film to an iDVD project the chapters of the film do know show in iDVD. Nor does iDVD automatically create a sub-menu for the chapters. I have ensured that the box is checked for 'chapter sub-menu'.
    I was wondering if it something do with the fact I created the chapters with SimpleMovieX. I was wondering if I should re-save the movie through Quicktime or 'something'.
    Thanks,
    Martin

    Where did you create this film? If in iMovie, you add chapter markers there. Ifd you export out of iMovie as a QuickTime Full Quality, it will remove the chapter markers. You have to Send to iDVD to preserve them, or drag the iMovie project file into a new iDVD project.

  • MySite Host Site Collection "Site Settings" Menu and sub-site creation

    Seemingly by design, users are able to create sub-sites on the MySite Host site collection when the configuration instructions here are followed: Configure My Sites in
    SharePoint Server 2013
    To be a little clearer, as instructed, I've created and applied a subsite-creation user policy to the web application hosting the MySite host. Presumably, this enables sub-site creation in personal MySite site collections. Perfect.
    Except... this also enables creation of subsites on the MySite host itself.
    If a (non-administrative) user clicks the cog from the Newsfeed page, the scope is the MySite host.
    The "site settings" link leads to the site settings of the MySite host.
    There, in the  "Sites Administration" section is "Sites and Workspaces".
    ...and there, is the option to create a new sub-site at https://my.contoso.net/. -_-
    How might I avoid this undesirable state of affairs? I would like to give users the ability to create sub-sites in their own MySites, but not on the MySite host via the Newsfeed page. Is this possible?
    I think I can. I think I can.

    This is definitely possible - So you enabled self-service site creation in Central Admin per the configuration instructions. Did you also create a user policy on the web application?
    In my tenant non-admins do not have access to click site settings on the mysite host (They can click site contents, which redirects to the personal site collection). Also, they do have access to click site settings on the personal mysite site collection
    though.
    Regards,
    Andrew J Billings
    Portal Systems Engineer//MCSA,MCSE
    Blog:
    http://www.andrewjbillings.com 
    Twitter:
      LinkedIn:
    I did some testing and figured it out, I think. Mind you everything worked properly, users just had access I didn't want them to.
    I did enable self-service site creation, and I created the user policy on the web application as per the instructions. I then discovered users had access to site settings on the Newsfeed page: https://my.contoso.com/default.aspx
    The only site setting they had access to was subsite creation: https://my.contoso.com/_layouts/15/newsbweb.aspx , but I didn't want them to be able to create subsites on the host, just in their personal collections.
    Deleting that user policy removed their access to subsite creation on the host, and still allowed self-service site creation, and the creation of subsites in personal collections, so the question now is:
    Why are we being directed to create that user policy in the first place, when it doesn't appear to affect personal sites at all?
    I think I can. I think I can.

  • How to personalize "menus" so sub menu can be zoomed automatically

    Hi,
    I have done a personalization in which i added a zoom function of responsibility details in user creation form(in sysadmin resp). That is working fine. I then added a zoom function in resp form of User menu which took me directly to the Menu entry form. Now i want to do personalization by which i can zoom in to the sub menu that is attached to the Main Menu(through special icon in tools menu). My understanding is that the global variables should only be used when navigating between 2 different form. Now i want to navigate to the sub menu which is the same form.
    I have tried some personalization but to no avail. Kindly can anybody provide me with a detailed idea of how this can be made possible.
    Regards,
    Fawad.

    Hi,
    I have done a personalization in which i added a zoom function of responsibility details in user creation form(in sysadmin resp). That is working fine. I then added a zoom function in resp form of User menu which took me directly to the Menu entry form. Now i want to do personalization by which i can zoom in to the sub menu that is attached to the Main Menu(through special icon in tools menu). My understanding is that the global variables should only be used when navigating between 2 different form. Now i want to navigate to the sub menu which is the same form.
    I have tried some personalization but to no avail. Kindly can anybody provide me with a detailed idea of how this can be made possible.
    Regards,
    Fawad.

  • Creating sub menu's under Abstract Action.

    Folks,
    I am trying to create a sub-menu under abstract actions.
    But when I run the application,I can only see 'Create New Positions' menu item;
    and cannot view/invoke the sub menu options(ie Create Position One/Two).
    Is there a way to create sub menu's under the main action menu? (in the code below please)
    Thanks,
    final ArrayList<Action> actions = new ArrayList<Action>();
    actions.add(new AbstractAction("Create New Positions") {
         public void actionPerformed(ActionEvent e) {
                   // Sub Menu options          
                   actions.add(new AbstractAction("Create Position One") {
                   @Override
                   public void actionPerformed(ActionEvent e) {
                   // Code to create position one                         
         public void actionPerformed(ActionEvent e) {
                   // Sub Menu options          
                   actions.add(new AbstractAction("Create Position Two") {
                   @Override
                   public void actionPerformed(ActionEvent e) {
                   // Code to create position two                    
    });

    Hi Thomas.behr
    I tried as you suggested :
    final ArrayList<Action> actions = new ArrayList<Action>();
    actions.add(new AbstractAction("Position Creation..."){
    public void actionPerformed(ActionEvent e) {
                            JMenu PositionMenu = new JMenu(new AbstractAction("Create Position one"){
              @Override
              public void actionPerformed(ActionEvent e) {
                   // TODO Auto-generated method stub
                   // actions.add( PositionMenu).... as action expects an Action
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Horizontal Spry Menu Bar with Horizontal Sub Menu

    I have created a horizontal menu bar with only one main menu item leading to a sub menu. I would like this sub menu to display horizontally also, instead of vertically as added by default.
    I am relatively new to dreamweaver and would appreciate any help possible.

    Came across the fix by accident thru extensions in menu bar,
    and choice of cursor for each section. Feeling happy! Happy New
    Year everyone.

  • Muse 2014 -sub menu items appearing on roll-over etc.

    Hi, complete newbie, so sorry if this has already been covered elsewhere. Only started using Muse about 1 month ago and now using Muse 2014 - using horizontal menu widget and discovered how it now shows sub-menus when hovering over the main menu item- I find this great!
    I want a 'Contact Me' page with a basic form and this is not a problem, however, I want the sub-menus to appear when hovering over the other main menu items, but not the contact me page - might be completely off here, but created a 'Thank you' page as a child page of the contact me page and only want this displayed (not as a sub-menu choice when hovering over the contact me main menu item) when they have clicked the submit button on the form (I know how to set this re-direction in the forms options). Have tried playing with menu on the master page - switching off the edit together and changing settings on only the contact me menu item - without success- seems to apply to all main menu items.
    I would like to know how to achieve sub-menus on other menu items - but not on contact me item;  or whether I am going about trying to have a 'Thank you' response when someone submits the contact me form in the completely wrong way - can this be better achieved by other means?
    I would really appreciate your advice and help. My published site is 'onyerbikegeordie.uk' with the main menus - except not with a contact me page as yet, but would  give you an idea of what I am trying to achieve except for a contact me page.
    Sorry for the long post, but thanks for reading and in anticipation of your help!
    Joe
    Message was edited by: Joe Fitzpatrick

    Hi, managed to find the answer to this myself. In Plan, right-click on page and select Menu Options > Exclude Page from Menus. Job Done!
    Joe

  • Cluster (sub menu) submit button grayed out

    hello all
    as of today my compressor has stopped allowing me to submit the batch i set up.
    having sent an item from FCP to compressor, i get to set the options for settings and destination and then when i hit the submit button a second menu pops down regarding cluster options of which i have none. i add a name to this box yet no mater what other options i change the *submit button in this sub menu remains grayed out!*
    http://twitpic.com/jj7n2
    i have tried reinstalling compressor, and eventually the whole suit. i have removed the various prefs and qmaster stuff. i have used the fix compressor utility from digital rebel, repaired permissions and cleared out cache, but still *grayed out submit*.
    what thoughts cloud genii?

    I'm having the same problem.
    This comes after suffering persistent crashing of Compressor 3.5 on launch and finally having to reinstall to at least fix the crashing problem. But now I can't submit any processes - the button is greyed out.
    Can't remember setting this up originally, but it use to say "This Computer" for processing - do I need to add my computer to a list of available processors?
    Any help hugely appreciated,
    Simon

  • Can't access in  Finder Contextual Menu  the sub-menu named More

    Hi!
    I was trying to learn how to use Automator, in the web page
    http://www.macosxautomation.com/automator/examples/ex03/index.html
    and I realize that I can't access in Finder Contextual Menu the sub-menu named More for choose Automator > Create Workflow... from the sub-menu.
    Someone can help me to configure the finder in order to

    That page is out of date since it doesn't reflect the change in Snow Leopard that did away with the More contextual menu. Try this. System Preferences->Keyboard->Keyboard Shortcuts->Services->Development->enable Create Workflow. Close the prefPane, select the object, CONTROL-click->Services->Create Workflow.
    If that solves your issue, then send a message to the page's developer and ask them to update it.
    BTW, see http://discussions.apple.com/thread.jspa?threadID=2241804 for a four-parter by Sal Saghoian on *Automation in Snow Leopard*
    and this, which describes the old and new automator—services stuff:
    http://www.reynoldsftw.com/2009/08/automator-and-finder-interactions-in-os-x-10- 6/

  • Sub-menu of eSubmit is empty in non-English language (Russian)

    BPC 7.5
    BPC for Excel in English is working correctly, but in Russian sub-menu of eSubmit is empty

    Hi Sorin!
    Thank you for reply!
    Yes, russian language for BPC installed.
    Test was done with the same user for both language - in english everything is ok, in russian except submenu of "eSubmit" too.
    Only eSubmit's submenu is empty
    p.s. I see and can run eSubmit's macros in Excel (in russian) if I add them on Excel toolbar as icon (not from Planning and Consolidation -> eSubmit -> ..)
    Edited by: Maxim Pak on Nov 17, 2010 6:57 AM
    Edited by: Maxim Pak on Nov 17, 2010 7:19 AM

  • Keyboard shortcut for Sub Menu item Only works AFTER using it

    I have a Custom MOVE TO READ Mailbox shortcut. This is a SUB Menu item.. MESSAGE/Move To/READ FOLDER.
    It is really sweet to clear out my INBOX and save emails.
    So, what is ODD is that that menu has to be Clicked on and shown each time MAIL is run for that keyboard shortcut to work.
    I find that Odd and would love to have it work without having to "train" it everyday.

    Hello,
    Post in the iTunes Forum: http://discussions.apple.com/forum.jspa?forumID=789
    Check out the AppleScript Forum also: http://discussions.apple.com/forum.jspa?forumID=724
    Carolyn

  • How to Center Text in Menu and Left Align in Sub Menu

    Hi - I'm looking to Center the text in the main menu of a Spry Menu in DW CS 5.5 but left align the sub menu's.
    If someone could point me in the right direction it would be much appreciated.
    Thanks
    J

    See here http://labs.adobe.com/technologies/spry/samples/menubar/CenteringHorizontalMenuBarSample.h tml
    Gramps

  • Positioning of spry sub menu in IE8

    Hi - can anyone help with an IE8 issue concerning Spry? I have created a menu here:
    http://www.clinicafiore.co.uk/jan2012/indexJan2012_1.html
    In all the browsers I have tested (Chrome,FF,Safari,Opera) on Mac and PC platforms it works fine. In IE8 it doesn't (hooray).
    The critical attribute is:
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
      left: 189px;
      top: 0;
    I.e. I have pushed the sub-menu out 189px when visible and set the top value to 0 thinking this would align the sub-menu with the top of the main menu item.
    Is there a better way to do this to cover all browsers or do I need some conditional code for IE?
    Really.really grateful for any help
    For good measure here's all the  html & the css
    HTML
    <div id="leftNav">
        <ul id="MenuBar1" class="MenuBarHorizontal">
          <li><a href="#" title="ageing body" class="MenuBarItemSubmenu">AGEING BODY</a>
            <ul>
              <li><a href="#">Ageing D&eacute;collet&eacute;</a></li>
              <li><a href="#">Ageing Hands</a></li>
              <li><a href="#">Ageing Neck</a></li>
            </ul>
          </li>
          <li><a href="#" class="MenuBarItemSubmenu">ageing face</a>
            <ul>
              <li><a href="#">Ageing Lips</a></li>
              <li><a href="#">Double Chin</a></li>
              <li><a href="#">Downturned Mouth</a></li>
            </ul>
          </li>
          <li><a class="MenuBarItemSubmenu" href="#">Item 3</a>
            <ul>
              <li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a>
                <ul>
                  <li><a href="#">Item 3.1.1</a></li>
                  <li><a href="#">Item 3.1.2</a></li>
                </ul>
              </li>
              <li><a href="#">Item 3.2</a></li>
              <li><a href="#">Item 3.3</a></li>
            </ul>
          </li>
          <li><a href="#">Item 4</a></li>
        </ul>
      </div>
    CSS
    ul.MenuBarHorizontal
              margin: 0;
              padding: 0;
              list-style-type: none;
              font-size: 0.9em;
              cursor: default;
              width: auto;
    /* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
    ul.MenuBarActive
              z-index: 1000;
    /* Menu item containers, position children relative to this container and are a fixed width */
    ul.MenuBarHorizontal li
              margin: 0;
              padding: 0;
              list-style-type: none;
              font-size: 0.9em;
              position: relative;
              text-align: left;
              cursor: pointer;
              width: 189px;
              float: left;
              font-weight: bold;
              text-transform: uppercase;
    /* Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
    ul.MenuBarHorizontal ul
              margin: 0;
              padding: 0;
              list-style-type: none;
              font-size: 100%;
              z-index: 1020;
              cursor: default;
              width: 189px;
              position: absolute;
              left: -1000em;
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
              left: 189px;
              top: 0;
    /* Menu item containers are same fixed width as parent */
    ul.MenuBarHorizontal ul li
              width: 189px;
              font-weight: normal;
              text-transform: none;
    /* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
    ul.MenuBarHorizontal ul ul
              position: absolute;
              margin: -5% 0 0 95%;
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
              left: auto;
              top: 0;
    DESIGN INFORMATION: describes color scheme, borders, fonts
    /* Submenu containers have borders on all sides */
    ul.MenuBarHorizontal ul
              border: 1px solid #CCC;
              font-weight: normal;
              text-transform: none;
    /* Menu items are a light gray block with padding and no text decoration */
    ul.MenuBarHorizontal a
              display: block;
              cursor: pointer;
              background-color: #aee56b;
              padding: 0.5em 0.75em;
              color: #333;
              text-decoration: none;
              border-bottom-width: thin;
              border-bottom-style: dotted;
              border-bottom-color: #FFF;
    /* Menu items that have mouse over or focus have a blue background and white text */
    ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus
              background-color: #999999;
              color: #FFF;
    /* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
    ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible
              background-color: #999999;
              color: #FFF;
    SUBMENU INDICATION: styles if there is a submenu under a given menu item
    /* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal a.MenuBarItemSubmenu
              background-image: url(SpryMenuBarRight.gif);
              background-repeat: no-repeat;
              background-position: 95% 50%;
    /* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal ul a.MenuBarItemSubmenu
              background-image: url(SpryMenuBarRight.gif);
              background-repeat: no-repeat;
              background-position: 95% 50%;
    /* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal a.MenuBarItemSubmenuHover
              background-image: url(SpryMenuBarRight.gif);
              background-repeat: no-repeat;
              background-position: 95% 50%;
    /* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover
              background-image: url(SpryMenuBarRightHover.gif);
              background-repeat: no-repeat;
              background-position: 95% 50%;
    BROWSER HACKS: the hacks below should not be changed unless you are an expert
    /* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
    ul.MenuBarHorizontal iframe
              position: absolute;
              z-index: 1010;
              filter:alpha(opacity:0.1);
    /* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
    @media screen, projection
              ul.MenuBarHorizontal li.MenuBarItemIE
                        display: inline;
                        f\loat: left;
                        background: #FFF;

    I may be misinterpreting what it is that you want, partly because I thought we were talking horizontal menu and you point out a vertical menu.
    I think that you used the vertical menu as an illustration to shopw how you want the submenu alligned. If that is correct, then please copy an paste the following into a new document and see the result in an IE8 browser.
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <link href="http://labs.adobe.com/technologies/spry/widgets/menubar/SpryMenuBarHorizontal.css" rel="stylesheet">
    <style>
    ul.MenuBarHorizontal ul {margin-left: 8em; margin-top: -35px;}
    </style>
    </head>
    <body>
    <ul id="MenuBar1" class="MenuBarHorizontal">
      <li><a class="MenuBarItemSubmenu" href="#">Item 1</a>
        <ul>
          <li><a href="#">Item 1.1</a></li>
          <li><a href="#">Item 1.2</a></li>
          <li><a href="#">Item 1.3</a></li>
        </ul>
      </li>
      <li><a href="#">Item 2</a></li>
      <li><a class="MenuBarItemSubmenu" href="#">Item 3</a>
        <ul>
          <li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a>
            <ul>
              <li><a href="#">Item 3.1.1</a></li>
              <li><a href="#">Item 3.1.2</a></li>
            </ul>
          </li>
          <li><a href="#">Item 3.2</a></li>
          <li><a href="#">Item 3.3</a></li>
        </ul>
      </li>
      <li><a href="#">Item 4</a></li>
    </ul>
    <script src="http://labs.adobe.com/technologies/spry/includes_minified/SpryMenuBar.js"></script>
    <script>
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </body>
    </html>
    If the above is not what you want, then please explain.
    Gramps

  • How to un-checked the sub-menu items in the active document?

    Can anybody let me know, how to make the "checked" sub-menu items in "Window" menu to "un-checked" through scripting. More clearly, i need to open a document alone without showing the tools bars, Document info, etc. Kindly help me the possiblities via scripting(vbscript / javascript). I am using illustrator cs3.
    Thanks...

    With vb you could call an action that changes the workspace. I do this with AppleScript but its only any use for in-house stuff where I know the actions and workspaces are saved.

  • How to create a menu with pages linked as sub menu in ADF?

    Hi Experts,
    I'm new to ADF and trying to create a menu like below in ADF.
    Actions Menu
    |
    |
    Option 1 -- A page with some static text and links.
    Option 2 - A different page with some static text and links.
    Have evaluated options like panelGroupLayout and menu components, requesting experts opinion on the best way to do it.
    Thanks in advance..

    Thanks AP.
    Not like outlook. Here's some more details on what I'm looking for.
    Create a menu bar.
    Create a menu called "Actions"
    Create two items under it called "Option1" and "Option2".
    When I move the mouse over "Option1", I want a page to be shown on the right (just like how a sub menu will be displayed usually).
    When I move the mouse over "Option2", I want to show a different page on the right (just like how a sub menu will be displayed usually).
    Thanks in advance.
    Edited by: Muruhanantham C on Dec 28, 2012 12:51 PM

Maybe you are looking for