Creating custom menu item

Hi guys,.

I am creating a menu item in the main menu of InDesign. Is this possible with *.jsx?

The idea is to have the menu as follows: file | Change | Page layout | MyMenuGroup | Type of...

Thank you!

Insert this code into 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 queue (SCRIPTS_PATH + "Configure.jsx");
var ScriptAction1 is app.scriptMenuActions.add ("Configure");.
var EventListener1 is ScriptAction1.eventListeners.add ("onInvoke", Script1, false);.
var utilesScriptMenuItem1 = companyMainMenu.menuItems.add (ScriptAction1);
  
var sub-menu; 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);

Tags: InDesign

Similar Questions

  • dynamically create and destroy the custom menu item

    I have a standard TestStand platform that I use on multiple systems.  On some systems, I have a few sequences of calibration and I would like to have the Update menu to have the RunSequence of these sequences of calibration.  I know how to manually create these menu items, but they are no longer valid for some sequence files.  I would use the sequence SequenceFileLoad to dynamically create menu items and the SequenceFileUnload to destroy these menu items.

    I've played around with the API, but cannot determine the correct path to get to the create and destroy the custom menu items.  Does anyone know how this can be done?

    Thank you

    Matthew

    Yes, see the online help for the members of the following APIs:

    Engine.GetEditTimeToolMenuItems

    EditTimeMenuItems

    EditTimeMenuItem

    Basically, you get a collection of tool using Engine.GetEditTimeToolMenuItems () menu items and then call EditTimeMenuItems.Insert () or EditTimeMenuItems.Remove (). If you insert a you get returns an EditTimeMenuItem object on which you can change the settings.

    In addition, since it has an expression to hide items in menu tool, you need not necessarily to destroy, you can hide them instead.

    Hope this helps,

    -Doug

  • Cannot create the custom menu item

    I feel that I'm missing something simple here.  Use the examples in the documentation for the BB developer, I am unable to get a custom menu item is displayed on a BB application menu in a simulator.

    More precisely:

    I copied the code for ContactsDemo (on page 31 of the PDF Advanced Developer) subjects, and works very well in the Simulator.

    I then copied the code for DemoAppMenuItem (from page 86 of the same doc).  It seems to work very well - no errors, and it appears in the Downloads folder on the Simulator.  But no custom menu item appears on the simulator when I create a new Contact, and then return to view it.

    I have all three options checked in Workspace Blackberry > Blackberry JDE > Code signing.

    My environment is:

    Eclipse 3.4.2

    BlackBerry JDE plugin 1.0.0.67 Eclipse

    I tried it with two simulators 4.5 and 4.6.

    Any suggestions are greatly appreciated!

    Thanks for the references page - this is a great compilation of resources!

    I don't know why the sample code of the documentation of EDGE does not work, but I was able to get the custom display menu item using the code I found this message on the forum.

  • Getting context object null when using the custom menu item.

    Hi all

    I implemented a sample application to add menu item custom to the list of messages and we test this build on 9000 os 5.0.0.41 Blackberryy 1

    On BB 9000, we have 2 message inbox, A like Blackberry by default message inbox and B as long as the Inbox for the e-mail account, I have set up on BB 900.
    I implemented the menu custom application to add menu on the message list option.
    I see this option on both my inbox, the question that I am facing is when I click on the menu item by selecting the email in the message of default A Blackberry inbox I can get the context object were like when I click on the same message next to the Inbox B I'm always get the context as a NULL object.

    Below is the code I used to add the custom menu item.

    Public Shared Sub main (String [] args)
    {
    If (args! = null & args.length > 0) {}
    call from another entry point. Add menu items mark as Spam and mark as suspects.
    {if(args[0].) (Equals ("GUI"))}
    try {}
                            
    create menu items.

    MyMenu ApplicationMenuItem = new EmailFile();
    Add the menu item in the list view and send by e-mail.
    Amir ApplicationMenuItemRepository = ApplicationMenuItemRepository.getInstance ();
    amir.addMenuItem (ApplicationMenuItemRepository.MENUITEM_MESSAGE_LIST, mymenu);
    } catch (Exception e) {}
    Utility.debugLog (try (), CLASSNAME, 'hand', Utility.EXCEPTION_INFO);
    System.out.println("Error:"+e.ToString());)
    }
    } else {}
    show on the application of spam...
    AppMain _theApp = new AppMain();
    _theApp.enterEventDispatcher ();
    }
    } else {}
    show on the application of spam...
    AppMain _theApp = new AppMain();
    _theApp.enterEventDispatcher ();
    }
    }

    Can we know what is the problem in my code or something I'm missing.

    Thanks in advance.

    Navneet Gupta.

    application menu items have been bugged for ages. There is nothing you can do except change your workflow. in some cases, you can recover the app screen and trying to extract something of these fields, but becomes more difficult in the new OS versions because of custom fields used by rim.

  • Add a logo image to a custom menu item

    I created a new custom menu item 'Export' in adobe illustrator CS6.

    What I want to know is that is it possible to add a small logo along the side of the 'Export' text on this menu item in adobe illustrator CS6 as below next to the opening, printing etc..

    ss.png

    Without going through the SDK. You might be able to hack one using platform-specific menu calls, but I do not think that the SDK has something to help you map their handles for menuitem to the menu system handles.

  • Custom menu item at the request of Message: two questions

    I try to add a custom menu to the Blackberry message request and get two questions:

    1. When you click the custom menu, the "Application.getApplication () .requestForeground (); method call does not call the main() method of my application "DemoMI".
    2. If I changed the method of

    Application.getApplication () .requestForeground)

    TO

    ApplicationManager.getApplicationManager () .runApplication (app); Where app is the "DemoMI" application descriptor

    Will be called the main() method. However, how can I make the subject of the Message around in the method "run" for the application "com.demo.DemoApp"?  I tried to use a static variable 'mi ContactsDemoMenuItem', but I've always had "null" value when the "main()" is called.

    My environment:

    • JDE: 4.2.0
    • Feature: Pearl 8100 with OS 4.2.0
    import net.rim.device.api.system.*;
    import net.rim.device.api.ui.component.Dialog.*;
    import net.rim.blackberry.api.menuitem.*;
    import net.rim.blackberry.api.pdap.*;
    import javax.microedition.pim.*;
    import net.rim.blackberry.api.mail.Message;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.*;
    import net.rim.device.api.ui.component.*;
    import net.rim.device.api.ui.container.*;
    
    public final class DemoMI extends Application
    {
        private static final String ARG_LAUNCH_CONTACT_DEMO = "1";
        private static  ContactsDemoMenuItem mi;
        public static void main(String[] args)
        {
            if(args == null || args.length == 0)
            {
                DemoMI app = new DemoMI();
                app.enterEventDispatcher();
            }else
            {
                String appToLaunch = args[0];
                if(ARG_LAUNCH_CONTACT_DEMO.equals(appToLaunch))
                {
                   new com.demo.DemoApp(mi.getMessage()).enterEventDispatcher();
                }
            }
        }
    
        DemoMI()
        {
            long locationToAddMenuItem = ApplicationMenuItemRepository.MENUITEM_EMAIL_VIEW ;
            ApplicationMenuItemRepository amir = ApplicationMenuItemRepository.getInstance();
            ApplicationDescriptor app = ApplicationDescriptor.currentApplicationDescriptor();
    
            app = new ApplicationDescriptor(app, new String[]{ARG_LAUNCH_CONTACT_DEMO});
            mi = new ContactsDemoMenuItem(app);
            amir.addMenuItem(locationToAddMenuItem, mi);
            System.exit(0);
        }
    
        private static class ContactsDemoMenuItem extends ApplicationMenuItem
        {
            ApplicationDescriptor app;
            Message msg;
            ContactsDemoMenuItem(ApplicationDescriptor app)
            {
                super(20);
                this.app = app;
            }
    
            public String toString()
            {
                return "My Menu Item";
            }
    
            public Message getMessage()
            {
                return msg;
            }      
    
            public Object run(Object context)
            {
                if ( context instanceof Message )
                {
                    msg = (Message)context;
                    try
                    {
    
                        Application.getApplication.requestForeground();
                        //ApplicationManager.getApplicationManager().runApplication(app);
                    }catch(Exception e)
                    {
                        e.printStackTrace();
                    }
    
                 } else
                 {
                    throw new IllegalStateException( "Context is null, expected a Contact instance");
                 }
                 return null;
            }
        }
    }
    

    What you see is the expected behavior.  The ApplicationMenuItem runs in a different process where your application was run.  You have two options.

    You can store the subject of the Message in the RuntimeStore when the ApplicationMenuItem is called.  Your application you are undertaking could then read the subject of the Message of the RuntimeStore.

    Or you can create an application based on the drawing below:

    How to allow - a listener in the background to detect and update a GUI application
    Article number: DB-00406

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800783/How_To _...

  • Custom Menu items are not displayed

    With the help of LV 8.5, I want to change my VI by program menu bar.  I'm not using Edit > Run-time Menu...

    I deleted almost all menu items by default ('File', 'Edition', etc) except "Help", and then inserted my own menu 'Config '.

    In the IDE, it works fine; When I make an executable from my menu does not appear.  Instead, the default items

    I deleted have indeed disappeared, and the only point is "Help".

    What I am doing wrong?  I looked at positions where it says add an element name and the element tag and I looked at all the

    Examples of LV for adding a menu.  Things are fine until I build the executable and then my little menu item just does not appear.

    There is no reason why I couldn't use Edit > run Menu... but I thought I could do it programmatically.  Just trying to understand what causes my menu to not appear.

    Now that I see your code, it makes sense. The reason why it does not work the way you had it before, it is that you are actually getting an error when you run the application. The error is because not all of these menus actually exist in the runtime environment. Thus, the function to delete the Menu items generates an error, and the rest of the code is bypassed. The example removes simply all of the menus, and no error is generated, since only the menus that actually exist get deleted.

  • Custom menu item

    Hello world

    I wonder what are the settings to use in

    super("Some text here", priority, ordinal);
    

    to get this line above the custom point Menu as it is above to "shut up" by default?

    I guess you do not want to use super, but the constructor of the MenuItem class.

    the narrow question has a fixed ordinal, you can call super.makeMenu and check its elements to it, I think it was about 2600000.

    Read also
    http://www.slashdev.ca/2008/05/07/MenuItem-Demystified/
    to better understand the menus.

  • JavaScript: create menu buttons how custom toolbar items in the designer?

    Hello!

    Is it possible to create custom menu items or toolbar buttons in the ADEP/LiveCycle Designer?

    Thanks for the tips!

    Marcos

    Generally no,.

    but since the Designer ES2, you can create macros to simplify your workflow.

    These macros can be brought in the Tools menu.

    Here's a few macros that I did the Designer ES2 RPF / designer of the ADEP:

    http://thelivecycle.blogspot.com/search/label/macro

    For more databases on the macros to read the blog of John Brinkman.

    http://blogs.Adobe.com/formfeed/category/macros

  • How - add a menu item custom application BlackBerry

    I'm working on an application that creates a custom in various standard Blackberry applications menu item.
    On the platform of v4.2.1.72 8800 2.3.0.54 everything works fine all the Blackberry PIM application that the spectacle of my menu item mail application custom.

    When I load on platform 8330 v4.3.0.124 3.1.0.71 none of the custom menu to the top and on the OS of the Pearl Flip is v4.6.0.48 4.1.0.13 only e-mail and todo/tasks application view my custom menu others do not show my menu item.

    I tried to compile my app in the various versions of the JDE, but always the same question.

    Am I missing something for the new OS?  I followed the knowledge base article "how - to add a custom BlackBerry application menu item.

    I tested it on 8800 v4.5.0.52 platform 2.7.0.66 and Mail and Memo shows no custom menu item in Contacts, calendar and ToDo my custom menu appears.

    Thank you...

    BTW do you know if I can add menu browser and retrieve the content of the web page?

    No, this is not supported.

  • creating a menu EXTRA in acrobat 10 item

    I have the following code that I used to create Additional menu items in Acrobat 9 using javascript. These menu options do not appear in Acrobat 10. The different encoding for Acrobat 10 is? I have the javascript code that is located in the folder of javascript in Acrobat to load when acrobat is opened.

    app.addSubMenu ({cName: "Footer", cUser: "set/remove Date Stamp", cParent: "File", Nonprofits: 20});

    app.addMenuItem ({cName: "Set Date Time", cParent: "Footer", cExec: "SetFooter (1)" ""});

    app.addMenuItem ({cName: "Set Date time (casting) ', cParent: 'Footer', cExec:" SetFooter (2) "" ""});

    app.addMenuItem ({cName: "remove Date time", cParent: "Footer", cExec: "RemoveFooter (1)" ""});

    function SetFooter (ARG)
    {

    var inches = 72;
    for (variety p = 0; p < this.numPages; p ++)

    {

    If (ARG == 1) {}
    aRect var = this.getPageBox ({nPage: p});
    aRect [0] += 1.54 * inch; the position of the left edge of the paper rectangle
    aRect [2] = aRect [0] + 3.8 * inch; field length
    aRect [1]-=. 15 * inch; distance from the top edge of the paper
    aRect [3] = aRect [1] - 18; height of the text box


    var fd = this.addField ("date", "text", p, aRect);
    fd.textFont = make. HelvB;

    }


    If (ARG == 2) {}
    aRect var = this.getPageBox ({nPage: p});
    aRect [0] +=. 35 * inch; the position of the left edge of the paper rectangle
    aRect [2] = aRect [0] + 3.8 * inch; field length
    aRect [1]-=. 30 * inch; distance from the top edge of the paper
    aRect [3] = aRect [1] - 18; height of the text box


    var fd = this.addField ("date", "text", p, aRect);
    fd.textFont = make. HelvB;

    }

    var myWillPrintScript = ' var fd = this.getField ("date"); \r'

    I have the following code that I used to create Additional menu items in Acrobat 9 using javascript. These menu options do not appear in Acrobat 10. The different encoding for Acrobat 10 is?

    No. I have no problem with the code.

  • Creating a menu close to avoid the garbage alert 'Changes' thing: P

    First, I searched and saw solutions for setDirty (false) or to replace the examples in onSavePrompt (true), however I am having some problems with this integration into my existing code.

    My class is extending to a different module screen (what is the problem?) and I am the makeMenu element substitution to fill my menu.

    What I'm asking is for the ability to hide the beast 'changes' invites the box, as shown in my element menu to close. What is my Code for the moment

    Here is a snippet of my code...

    public final class fgw_home_screen extends TooltipScreen implements TooltipListener, TxtPackResource {
    
        public fgw_home_screen() {
    
            //create a menu item for users to close the application
            private MenuItem _closeItem = new MenuItem(_txt.getString(BTN_CLOSE), 200000, 10) {
                    public void run()
                    {
                        onClose();
    
                    }
            }; 
    
            //override makeMenu to add the new menu items
            protected void makeMenu( Menu menu, int instance )
            {
                    menu.add(_closeItem);
            }
    }
    
    private MenuItem _closeItem = new MenuItem("Close", 200000, 10) {
       public void run() {
           close();
       }
    };        
    
    public boolean onClose() {
      return super.onClose();
    }
    
    public boolean onSavePrompt() { return true; }
    

    It works for me

  • Elements of custom Menu Application

    Hello

    From a configuration file, I'm giving the user the ability to add and remove Menu items which would appear on a native BlackBerry Application Java, for example calendar, Contacts etc. It's all the dory hunky, adding menu items to the repository and the native application, but without a reference to the original object (which I think is garbage collected and stored somewhere in the depths of the BB database), I can't remove the added custom Menu item previously. (tried static member variable, and overwrite the previous text to menu items, just appears as a value that is duplicated in the menu)

    I read forums and manuals and the API extensively, but I did not yet find a solution.

    I read people who come on this issue, if there is a plausible solution, could you give a shout!

    See you soon,.

    Nik.

    If you want to remove an ApplicationMenuItem, you must keep a reference to the real menu item that you have added and use this reference to remove.  I find the best place for this is RuntimeStore.

    BTW do not know if you do this available to old BlackBerry OS, but even if you do this, the removal does not work under OS 4.0, but the fact in the latest OS.  Sorry not tested prior to OS 4.0.

  • How to add the menu item in the context menu of the Gallery

    Hi all

    I am new bie BlackBerrry development. Does anyone know how to add a menu item in the context menu of the BlackBerry Gallery. In other words, when I am browsing photos in the Gallery, click on the menu, there will be a configurable option so that my request will be executed when I select this item.

    Thank you
    TuanSandman

    See this article.

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800367/How_To _...

    Check the class ApplicationMenuItemRepository for applications where you can add the custom menu item.

  • Card of formulation - UPDATING features of menu items

    Hello. We would like to add a new button in the box tools (say after the 'Settings' button) in the form of wording to make the refresh rate formulation.

    The option REFRESH the item menu is available when the specification of the formulation is in EDIT mode in the TOOLS menu items section.

    We want to make this feature via a new button in the box tool. In this way the button will still be visible and will help users do not forget to REFRESH the data.

    We intend to use the point of post to add a new button. The new button should call/call existing functionality to update the spec.
    How can we use out of the box functionality to perform the REFRESH functionality?

    Thank you.

    See the Config Guide of Navigation in scalability Pack (Agile Documentation) to create a menu item in GSMNavSpec toolbuttons.

    1. in config\Extensions\SiteMap-Extensions.xml, add the following xml elements if you don't have them.

    2. in the menu item toolbuttons, add the menu Refresh void as below, which is copied from config\Reference\SiteMap\SiteMap-GSM.xml.

    3 change its menu type, order of sorting and styles as you like.

Maybe you are looking for

  • iPhone 3d 7 touch vibration does not

    My vibration tactile 3d stop random work... ive tried all settings like turn touch 3d and vibrating, too much accessibility. The only thing that will fix this restart my phone but he ends up back in a few hours... im thinking it might be a bug. Ive a

  • Disorders of the Internet by Satellite P855-S5200

    So I have a Toshiba laptop Satellite P855-S5200 and all works well, including most of the Internet features. The problem I have is that no matter what internet service provider, I use some things won t work. For example, you place your order online f

  • How to install the OS on Portege 3110 CT?

    Hello I'm saving a Portege 3110 CT, which has had its hard drive wiped. My win98 boot disc is somewhere, but the CD drive is not recognized. (Mobile CD ROM F-TO-TCD - 24L) Can someone help me get to the next step please?

  • Upgrade RAM or OSX first?

    I want to speed up my end 2011 MacBook Pro by adding RAM (4 GB to 8 GB) and update of Lion to El Capitan.  No matter what I do first?

  • removed the stick without saving, now "cannot open".

    I removed my memory stick in a race and I forgot to save it.  Now I am panicking because I worked one week on the file now "cannot be opened. I tried to double click on the preview then and it just shows a picture of the logo pages bearing the name o