Programatically creating Menu item

Is It Possible to create Menu Items Programatically If Possible Then How to do it.
Thanks in advance.

Insert this code within a startup script:
    try{
        companyMainMenu=app.menus.item("$ID/Main").submenus.item("Company Name");
        companyMainMenu.title;
    } catch (e){
        companyMainMenu=app.menus.item("$ID/Main").submenus.add("Company Name");
    var Script1=new File(SCRIPTS_PATH+"Configure.jsx");
    var ScriptAction1=app.scriptMenuActions.add("Configure");
    var EventListener1=ScriptAction1.eventListeners.add("onInvoke",Script1,false);
    var utilesScriptMenuItem1=companyMainMenu.menuItems.add(ScriptAction1);
    var SubMenu; // First level submenu
    try{
        SubMenu=companyMainMenu.submenus.item("Submenu 1");
        SubMenu.title;
    } catch (e){
        SubMenu=companyMainMenu.submenus.add("Submenu 1");
    var submenuScript1=new File(SCRIPTS_PATH+"Action.jsx");
    var submenuScriptAction1=app.scriptMenuActions.add("Action");
    var submenuEventListener1=submenuScriptAction1.eventListeners.add("onInvoke",submenuScript1,f alse);
    var submenuScriptMenuItem1=SubMenu.menuItems.add(submenuScriptAction1);

Similar Messages

  • Create Menu items from table data?

    Wondering if anyone knows of a way(if even possible) to create menu items on logon from table data where the menu data is stored?

    You'd have to make the menu code generic as well - probably the bet bet would be to have each menu item calling a common procedure but passing in the menu item selected - you'll then have to cross reference that with the current function of that menu item and do the right thing.

  • Unable to create Menu Item List Buttons in Forms - Not Working!

    Hi guys,
    I need desperate help since I have been stuck on these for 2 days and I am unable to move forward!!
    I am trying to create a pdf form using Acrobat pro 9 and Adobe LiveCycle Designer ES. Since I am new to this, I have been browsing through numerous sites, forums and tutorials to learn about this. So far, I was able to create the forum with text fields, etc.. I am trying to have a column in my pdf form where the users can simply copy & paste image icons here..I was having difficulty with this already and have done numerous searches in google. In the end, I thought I am better off trying to use the "stamp" tool for this instead of image field. So this is what I did:
    1) I already placed the image icons (that the users will be copying & pasting) on my pdfs so users can simply click on it to select the image.
    2) I added a new bottom to this form which has the short cut to the menu item "copy" function. I labeled this button as 'Copy' and to this button, I added the following javascript for "Mouseup":
    app.execMenuItem("CopyFileToClipboard");
    3) Next I created another button that I called 'paste' and this button executes the "Paste Clipboard Image as Stamp Tool" menu. This button has the following javascript:
    app.execMenuItem("Annots:Tool:StampFromClipboardMenuItem");
    I thought that after doing the above, the user should be able to click on one of the images in the pdf, then click on 'copy' button and in the end click on 'paste' button that will then run an action so user can stamp this copied image to where ever they want in that file. But this is not happening!! I dont why?? Nothing happens when these buttons are clicked. I have made sure that the "Extended features in Adobe Reader..." is enabled and also tried running the above javascripts on my console window to test it and i know that the actual javascript code is not at fault since these functions works when I try the code through the debugger window. But I just cannot figure out why these menu item functions are not working when the buttons I had created are clicked!!! I dont know if what I have done is correct or if there is a easier way to achieve what I am trying to do!! Its a shame there is no simpler way for the end-users to copy and paste images to the columns in the pdf forms.
    please help me understand why the above button are not working....any help will be great!!

    Hi Paul,
    This is further to our email correspondence. I am just pasting your email response here since it may be useful to other newbies like me:
    "Ok here you go ......I had to add the new row via a script object as the new objects are not completely available until the script ends so I cannot resize the new row from teh current script.
    Then when we resize - we have to resize the row, the cells and the image ....we start with all existing subforms then we do it for the new row that was just added.
    Lastly I see that you have a delete row button. This will have to be part of the row otherwise we ill not know which row the user will want to delete .....unless you ask them (which is not good UI design)."
    I was really impressed the way you modified the script so the table height does not change when new rows are added. That did help me in understanding the methods and it will certainly be v useful to me in the future. I have been practicing and getting a hang of LS and I have actually decided to redesigned my form since it appears that trying to have a fixed table height is quite a bit of work each time a row is added, removed or changed, etc... Your advise so far have been v helpful and it has helped me in redesigned the form into a different layout. So far so good...However, I just have a few more clarifications regarding some hurdles I am facing:
    PS: I have emailed you a sample of my new form now so you can have a look at it.
    1) Dynamic Image fields:
    In this form, I have a subform that has a dropdown list and next to this, I have an image field. I want to change the image based on the selection in the dropdown list. I found a few samples and tutorials on this already and I tried 2 different approach for this. One works and the other doesnt.
    Method that works: What I have done here is, I added all the images in the form and have put their presence to invisible. Then using the javascript, I am making the image visible based on the selection in the dropdown list. I found this method somewhere through googling and it works.
    Method that doesnt work: Its similar to the above, but instead of putting all the images in the form, I just inserted 1 image field and then tried to change the url of this dynamic image based on the selection in the drop down list. But this method is not working. I tried inserting this jscript and nothing happens:
    switch (this.rawValue)
    case "1":
    myImages.value.Image.href=http://www.mysiteaddress.com/blah_blah.jpg;
    break;
    case "2":
    myImages.value.Image.href=http://www.mysiteaddress.com/blah_blah2.jpg;
    break;
    The 2nd method does not work. Although I know the method 1 above works and I am currently using it, I am just curious to find out why the 2nd method is not working? Did I get the script wrong or is this feature no longer allowed? I just thought that if the second method works fine, it saves the hassle of putting all the images on the form and then making them hidden. Instead, I just need to put one image field and then dynamically change its image based on the selection. I hope this make sense..please advise..
    2) Changing the background colour of the Dropdown list box:
    I am trying to change the bg colour of the listbox in the dropdown list object (only the listbox bg color and not the whole background color). So, I added the following script to the mouseEnter event and this works:
    var vName = this.somExpression;
    var fieldObj = xfa.resolveNode(vName + ".ui.#choiceList.border.fill.color");
    fieldObj.value = "255,255,225";
    My Problem: The above script works so I dont need to change anything there. But, I also want to add another script to the mouseExit event to change the fill color to its default once the mouse leaves the dropdown lists. Initially, this field has no fill colour and the border fill style is none. The fill color is only added during the mouseEnter event. How do I change the bg color fill back to none during mouseExit after the above script is executed on mouseEnter?
    (NOTE: If you see my form, I have used the above scripts for the dropdown list only in "boxSubform[0]".)
    3) Changing the length of the Dropdown List box:
    I only have about 1.6 inches workspace to add this dropdown list box. However, the length of some lists (list items) in this dropdown list box is actually longer and the remaining part is cut out. So, I added the following script to increase the dropdownlist length and it does not work the way I would have hoped...
    The script I have written so far:
    I added these to the mouseEnter event and it works fine -
    form1.pageSubform.dynamicSubform.Table1.Row1.boxSubform[0].MyDropdown::mouseEnter - (JavaScript, client)
    this.w = "2in";  //this is to to increase the width of the dropdown list
    I added these to the mouseExit event and it works fine too-
    form1.pageSubform.dynamicSubform.Table1.Row1.boxSubform[0].MyDropdown::mouseExit - (JavaScript, client)
    this.w = "1.625in";
    When I tested the form with the above script, this is what happens:
    1) First when you move the mouse over this field, the width increases. Similarly the width decreased when you move away.
    2) So, even if this is clicked, the list box is opened with this 2inch width so thats good.
    3) There are no problems when the mouse is moved over these list items as well. However, this does not look good when the dropdown list item is clicked with its item lists open and then the mouse leaves this area. In this case, as soon as the mouse leaves this area, the mouseExit script runs and hence it makes the drop down list width to shrink eventhough the list items are still open. How do I resolve this? I was thinking about this and I thought the possible way to overcome this is by writing a javascript for the mouseExit event executing something like this:
    if this dropdown list is open,
    then  this.w = "2in";
    else
    this.w = "1.625in";
    I am not sure how to write a jscript for the above?
    (NOTE: If you see my form, I have used the above scripts for the dropdown list in "boxSubform[0]".)
    4) Hiding the alternative row shadowing for hidden columns:
    If you check out my form, you can notice that I have put the "close" button (button to delete table rows) on the left column and I have also put its presence to "Visible (screen only)". The parent table has got the 'alternative row shadow' checked. What I notice here is, when this page is printed, eventhough the first column's presence is set to "Visible (Screen Only)", it still prints the row shadow for this column and it looks bad. How can I fix this? Any help will be great!
    I have already emailed you my new form again so you can have a look.
    Thanks again Paul and I cant thank you enough for your help. I am sooo happy to see such a great support and resources available here since it can be a nightmare for some newbies like me... :-)

  • Creating Menu items on Track

    I'm creating a music DVD for a school project. The Main Menu has a Play All and Select Song featuring music from the band I recorded. My professor has requested that, for the songs, he be able to navigate using buttons between songs. Basically I set up a track with chapter marks dividing the different songs and the Chapter Skip key works on a remote, but he wants to be able to see which button he is pressing, as in "Previous, Back to Menu and Next."
    Does anybody have a solution to this?

    If I understand you correctly
    Just make onscreen buttons, and create navigation for each one that jumps to a specific song, the next or the previous one.
    Add a Main Menu button on screen as well.
    Look in the manual regarding navigation.
    Read The Fine Manual, within it is power.
    RTFM

  • How to create a new menu item.. please help

    hi every one..,
    i bought a new 30GB ipod .., i would like to create a new menu item in the ipod and wanna generate all my content whichis in my database to this newly created menu item in my ipod....
    any reply to this will be greatly appreciated..
    thanks in adavance
    Prem
    AMD athlon 64. 2400+   Windows XP Pro   1.8GHZ, 512 MB RAM

    Prem,
    First of all, Welcome to the Apple Discussion Forums!
    If you get no response here you may want to post your question over in the iPod Discussion Forums for the quickest response.
    Pick the forum of the iPod in question (Usage).
    Just thought that might get you a better/quicker response than here.
    good luck,
    littleshoulders [:-)

  • Menu Items does not display after Making ARD file

    Hi Experts
    I have created a Addon Which has Five Menu Items. Three Items in Setup->Inventory and Two in Inventory->Inventory Transcation. It will woriking fine when I run my addon from Visual Studio directly But after created ARD file It does not show Menu items. There was no error during making ARD. I tried three times. But result is same it does not show any Menu Items. Plz suggest me Code is given below. I Use VB B1 AddOn Wizard for creating Menu Items This has a seprate addMenu.xml module.
    <Application>
      <Menus>
        <action type="add">
          <Menu Checked="0" Enabled="1" FatherUID="43540" Image="" Position="9" String="Bin-In" Type="1" UniqueID="AM_1" />
          <Menu Checked="0" Enabled="1" FatherUID="43540" Image="" Position="10" String="Bin-Out" Type="1" UniqueID="BINOUT" />
          <Menu Checked="0" Enabled="1" FatherUID="43540" Image="" Position="11" String="Intra-WH Movement" Type="1" UniqueID="INTRA_WH" />
          <Menu Checked="0" Enabled="1" FatherUID="11520" Image="" Position="12" String="Zones" Type="1" UniqueID="Zone" />
          <Menu Checked="0" Enabled="1" FatherUID="11520" Image="" Position="13" String="Bin AddOn Setup" Type="1" UniqueID="Setup" />
          </action>
      </Menus>
    </Application>
    Thanks
    Gorge

    Hi,
    Did you included the AddMenus.xml in the extra files when you generated the installer?
    The AddMenus.xml file needs to be in the same folder as the addon exe. If there is no AddMenus.xml file there is no error raised, B1DE thinks there are no menus to add.
    You have to include all extra files in the installer when you generate it.
    Hope it helps
    Trinidad.

  • Pop up description on menu items; how to change the text

    When hovering over my manually created menu items a pop up appears displaying the target html page. How can I turn this off or change the text to a description of the page?
    www.FlyWranglersTV.com
    DPTom

    Bonjour,
    How to turn off the tooltip:
    http://discussions.apple.com/message.jspa?messageID=7050854#7050854

  • Render menu item conditionaly in contextMenu

    Hi,
    I am having a tree with contextmenu facet. Also, I have a "Actions" drop-down with the similar set of menu items in my toolbar. I use the same jsff for both the menus like this:
    1) for tree context-sensitive menu:
    <f:facet name="contextMenu">
    <af:popup id="popContextMenu"
    rendered="#{userCanEdit}"
    contentDelivery="lazyUncached">
    <f:subview id="contextView">
    <jsp:include page="/oracle/communications/brm/pdc/ui/fragments/changeset/changeSetContextMenu.jsff"/>
    </f:subview>
    </af:popup>
    </f:facet>
    2) For Actions dropdown:
    <af:menuBar id="mb1" rendered="#{userCanEdit}">
    <f:subview id="csMenuBar"
    binding="#{viewScope.workspaceBean.csMenuBar}">
    <jsp:include page="/oracle/communications/brm/pdc/ui/fragments/changeset/changeSetContextMenu.jsff"/>
    </f:subview>
    </af:menuBar>
    My use case is, I need to show "Create" menu item if menu is accessed using Actions drop-down. However, if user right clicks the tree node "Create" should not be displayed in context-sensitive menu. Any idea how can I distinguish the source of event, what should be the EL in "render" property of commandmenuitem?
    Regards,
    Afroz

    Hi John,
    I tried following:
    <f:subview id="csMenuBar" binding="#{viewScope.workspaceBean.csMenuBar}">
        <jsp:include page="/oracle/communications/brm/pdc/ui/fragments/changeset/changeSetContextMenu.jsff" flush="true">
                         <jsp:param name="isAction" value="true"/>
         </jsp:include>
      </f:subview>And in the included page I try to read this parameter using El : *#{param.isAction}*
    However, #{param.isAction} always returns blank. Looks like the parameter is not passed to the included page. Is there any other way to read this parameter?
    Regards,
    Afroz

  • Using XMLLIST - Enable/Disable Menu Items

    I am using XMLList for creating menu items.
    I want to enable / disable menu items based on the permissions to the user.
    Below is the code snippet:
    <fx:XMLList  id="newData">
                                  <menuitem id="item1" label="{resourceManager.getString('taskmgmt', 'taskmgmt.label.newProject')}" />
                                  <menuitem id="item2" label="{resourceManager.getString('taskmgmt', 'taskmgmt.label.projectFromTemplate')}" enabled="false"/>
                        </fx:XMLList>
    private function ItemClickHandler(event:MenuEvent):void
         if(PermissionManager.isAddPermitted("WTM_PROJECT_PLANNING")){
                                                           ProjectAssignmentModel.projectAssignmentFlag=false;
                                                           if(event.item.@label == resourceManager.getString('taskmgmt', 'taskmgmt.label.newProject')){
                                                                     clearModel();
                                                                     dispatchEvent(new SwitchViewEvent(SwitchViewEvent.SWITCH_VIEW_EVENT,false));
    protected function newMenuButton_clickHandler(event:MouseEvent):void
                                            if(! PermissionManager.isAddPermitted("WTM_PROJECT_PLANNING")){
                                                      newData.item1.enabled = false;
                                            else
                                                      menuList.dataProvider = newData;
                                                      menuList.show(event.stageX + 5 , event.stageY + 5);
                                                      mode = CREATE;
    Based on the permission, I want to dynamically enable / disable the "New Project" button.
    Can someone provide information how to achieve this ?
    Further update on this, it is giving the following error while running of the application:
    "TypeError: Error #1089: assignment to list with more than one item is not supported"

    Resolved by using the correct Data Provider and iterating through the list

  • How can I change the state of a runtime menu item programati​cally?

    Using LabView 6.1, I would like to change the state of the runtime menu item "Operate/Print at completion".
    The goal here is to print the VI front panel according to the operator choice (OK ->print, Cancel ->don't print)
    In a first release, I put a Stop function at the dialog output (activated by the cancel button) but this function stop the complete application and my idea where to stop only the VI in which the dialog is running.
    In a second release, I've tried to use the "Application
    control/Menu" but I receive every time an error:
    Error 88 occured at Cannot modify application menu item in the printtest.vi.
    Possible reasons: LabView, Runtime menu error...
    Any suggestion is appreciated.
    Re
    gards,
    phidu

    Instead of using the print at completion option, print the VI programatically if the user selects to print...open a reference to the VI you want to print and use an invoke node to print vi to printer.
    Alternatively create another VI with a layout optimized for printout, set it to print at completion and run and load the data into that VI if and only if the user OKs the print...
    Mads
    MTO

  • How to create a cursor in menu item???

    Hi,
    How to create a cursor in menu item??? and process data inside the SQL Editor of Menu Item>????
    Regards,

    ok, you mean: When the form is starting you want to disable some menues.
    create a WHEN-NEW-FORM-INSTANCE-trigger in your form and then do the loop over the menu-item
    what is ENTITIES? The name of a table ?

  • Create an context menu item to open a file on a specific display

    Hello,
    I have an external display connected to my MBP, but I don't always need to use it so it's not always on. I'd like to have a way to open a file (or application) on a specified display on a case by case basis. I know that I can assign an application to open on a specific display by right-clicking on the app in the dock and selecting options->assign to. The problem with this is that it's a global change. When I'm working on school work, I usually like to have reference material (pdfs, wepages, etc) open on the external display while I'm working in Word on the MBPs monitor.
    What I'd like to be able to do is right click on the file (or app) and use a context menu item to open the item on a specific display. Does anyone know of an automator action/applescript/terminal command to create a context menu item like this?
    Thanks.

    I use "Open Terminal Here" script for that:
    http://www.entropy.ch/software/applescript/

  • How do I edit and create new Spry2 menu items?

    I have manged to use adobe air to style and insert a spry2 menu - looks OK
    However,I do not undestand how to edit the menu items
    i.e. creating new menu items and adding new sub menu items
    On spry1 it was easy - just click the top of the menu and a wizard appeared at the bottom of the page
    The spry2 menu icon seems to be unclickable/greyed out?
    Can anyone help
    [email protected]

    Thanks for the reply - I already thought of that and I can edit the menu using code view (although I am not sure how you would 'see the sub menus in design view?) but I was wondering if spry2 has the same time saving wizard in the properties panel (as Spry1) that simplifies and speeds up the process?
    To restate the question: I can see a spry2 menu icon in the properties panel but it doesn't do anything as it's greyed out.
    Is there an option in dreamweaver (or adobe air which styles the menu) that makes a menu wizard work in the properties panel?
    If not then I guess I have to do it in code view - very tedious!?
    Jonathan
    [email protected]

  • Why do keyboard shortcuts for menu items created in System Preferences appear in Firefox menus but not work?

    Given that Firefox does not obey the System Preferences custom keyboard shortcuts, why does it still display those shortcuts in the menus, thereby incorrectly telling users that they will work?
    This issue was raised 6 months ago, but the only posted answer did not explain why the menus reflect the shortcuts that Firefox doesn't obey.

    Outlines are discussed in a series of articles beginning with Creating an Outline in Chapter 5 of the Pages '09 User Guide. A similar set of articles, beginning with Creating Lists follows immediately.
    Reading through the articles, I don't see any mention of a keyboard shortcut or menu item related to moving an item up or down in the list. A search through Pages '09's menus was also unproductive.
    Apparently this 'essential function' is unsupported in Pages.
    Feature requests should be made through Provide Pages Feedback, found in the Application menu (in Pages, the 'Pages' menu), where they'll go to and be read by Apple. Here you're posting to Pages users, who can help you use existing features, but have no direct influence on missing ones.
    The Pages '09 User Guide, a searchable pdf document, is available for download via the Help menu in Pages.
    Regards,
    Barry

  • How to execute create PDF  menu item

    hi all,
    I need to bind two pdf files.
    I did that by using File->Create PDF->From Multiple Files option.
    I want to automate this work using javascript.
    How can i do this?
    How can i execute the menu item Create PDF?
    Thanks in advance and urgent please....

    For the Acrobat SDK, no, it is not possible because there is no API to allow developers to do so via AppleScript. Now on to the world of "unsupported".
    It "might" and I do stress the word *MIGHT* be possible via AppleScript System Events, but this is in all worlds is a VERY BAD way to do things. It requires that no other applications running in the foreground and if your application loses focus for another applications dialog box (i.e. Adobe Updater, Mac OS X Software Update, etc...) you are, what some might say "hosed" because then your AppleScript no longer can execute properly. Surely NOT something to be used in a production environment.
    Sabian

Maybe you are looking for

  • Unable to see the report values in 2010 excel

    Hi Experts, We have got an issue here,we can see all the values of the workbook when we open it with excel 2007 or 2008.But when we use 2010 excel and open the workbook we can see "#NAME?"in the place of numerics....it would be great if you can sugge

  • JSP pages not displaying images in Jdeveloper

    HI I am using lot of images in the JSP page.But the JSP pages are not displaying images in Jdeveloper in Design preview. Do I need to install Apache for that?I have not installed Apache yet. If so then what are the configuration or settings I have to

  • Can't download the Oracle Application Server EJB 3.0 Preview

    Dear Oracle, When i press the "Download Here" hyperlink, i got a 30k size zip file and the name of the file is "oracle_ejb3.zip". But i can't unzip it, my operating system pop up an error message box. Please help me to download the software. Thanks a

  • Invalid certificate:  No Active Certificate for Content Repository

    Hello, I am trying to store DMS documents in Documentum.  We have already performed the exercise in a sandbox environment.  We moved to a development system on the SAP side and we are trying to use the same repository on the Documentum side.  We have

  • Migrating from IBM-Hyperion solution to Hyperion solution

    Hi,<BR><BR>in our production system there is IBM-Hyperion solution, but we need to migrate to Hyperion only solution, because IBM has decided that will no more support IBM-Hyperion solution. But looking to web page <a target=_blank class=ftalternatin