How to assign script to menu item? (JS, CS3)

Hi All,
I can't find out how to assign a script to a menu item. Instead of clicking a script name in the script panel, I want to appear a menu item in the menu bar. When I click that name on the menu bar I want a certain script to run.
I've managed to put the menu item in the menu bar, but not to assign the script to it.
many thanks
marco

Hi Marco,
Here is an example:
#targetengine "kasyan"
var myScript1 = new File(app.filePath + "/Scripts/Scripts Panel/Preflight CS3 v3.2.jsx");
var myScriptAction1 = app.scriptMenuActions.add("Preflight Document");
var myEventListener1 = myScriptAction1.eventListeners.add("onInvoke", myScript1, false);
var myScript2 = new File(app.filePath + "/Scripts/Scripts Panel/Rename Sections v3.1.jsx");
var myScriptAction2 = app.scriptMenuActions.add("Rename Sections");
var myEventListener2 = myScriptAction2.eventListeners.add("onInvoke", myScript2, false);
var myScript3 = new File(app.filePath + "/Scripts/Scripts Panel/Check 100 3 SE.scpt");
var myScriptAction3 = app.scriptMenuActions.add("Check Resolutuon of Images");
var myEventListener3 = myScriptAction3.eventListeners.add("onInvoke", myScript3, false);
var myScript4 = new File(app.filePath + "/Scripts/Scripts Panel/Resize Images v16.1.scpt");
var myScriptAction4 = app.scriptMenuActions.add("Resize Images");
var myEventListener4 = myScriptAction4.eventListeners.add("onInvoke", myScript4, false);
try{
var myScriptMenu = app.menus.item("$ID/Main").submenus.item("Scripts");
myScriptMenu.title;
catch (myError){
var myScriptMenu = app.menus.item("$ID/Main").submenus.add("Scripts");
var myScriptMenuItem1 = myScriptMenu.menuItems.add(myScriptAction1);
var myScriptMenuItem3 = myScriptMenu.menuItems.add(myScriptAction3);
var myMenuSeparator1 = myScriptMenu.menuSeparators.add();
var myScriptMenuItem2 = myScriptMenu.menuItems.add(myScriptAction2);
var myScriptMenuItem4 = myScriptMenu.menuItems.add(myScriptAction4);
Kasyan

Similar Messages

  • 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

  • How to enable File- Export  menu item in custom Form

    I have created a custom form.The File->Export menu item is disable by default.how can i enable this menu item? I have tried
    APP_SPECIAL.ENABLE('FILE.EXPORT',PROPERTY_ON) at block level (when-new-block-instance ) and form level trigger(when-new-form-instance) but not able to enable the same.
    plz suggest way to get this functionality in custom form.

    Hi,
    check below documents can help
    Unable To Export From Files => Export menu option in Applications 11i [ID 275224.1]
    Unable To File > Export Data From A Form [ID 552268.1]
    Unable to Open or Save Export to a File [ID 218209.1]
    Export Menu Item Under File Menu Is Not Bringing Up Dialogue Box Or Openning Up Document [ID 263348.1]
    Regards

  • Hiding built-in Menu items in CS3 (JS)

    Hi all,
    Is there any option through javascript to hide ie. disable built-in menu items in CS3. Here our requirement is to hide the menu items like Hide Attributes, Hide Comments, Hide Processing Instruction in the XML palette. Have to disable in all the places.
    Thanks
    Vaasu

    Thanks,
    This helps a bit.
    What do I use for "SomeScriptMenuItem".
    I have tried...
    var myScriptMenuItem3 = myFileMenu.menuItems.add(myScriptAction3, LocationOptions.AFTER, "User...");
    var myScriptMenuItem3 = myFileMenu.menuItems.add(myScriptAction3, LocationOptions.AFTER, User);
    var myScriptMenuItem3 = myFileMenu.menuItems.add(myScriptAction3, LocationOptions.AFTER, 24);
    I want my menu item to appear after "User..." in the file menu.
    Thanks

  • Is there a video tutorial which shows how to manually assign pages to menu items?

    I have a need to build out two separate menus. In order to do that, I need to be able to manually assign pages to the menu. Thanks

    Here's a tutorial on adding a Manual horizontal menu widget that should help - http://www.adobekb.com/building_your_first_website_pt07.html#addingmanual.
    Basically you just need to switch to a Manual menu type through Menu options, select the menu item and link/edit its label. You add more menu items to the menu by hitting the + symbol that appears when a menu item is selected.
    Thanks,
    Vinayak

  • GUI scripting-select menu item in Mail's Styles popupbutton

    Hi,
    The following script complies without returning an error.
    In Mail, with a new message window displayed, the Styles sheet displayed (select Format>Style>Styles...), and the Favorite Styles radio button selected, the script below returns an error when it gets to the line "click pop up button item 'Bold'" (the menu does contain an item "Bold!").
    I'd prefer to select the menu item by name rather than by using keystrokes in the script because I will be adding styles to the Styles menu, which will result in changes in the numbering of items in that menu.
    Could someone please explain to me how to accomplish this?
    Thanks in advance!
    tell application "System Events"
    tell application process "Mail"
    tell first window
    tell first sheet
    tell first radio group
    tell radio button 2
    click
    end tell
    end tell
    tell pop up button 1
    click
    click pop up button item "Bold"
    end tell
    end tell
    end tell
    end tell
    end tell

    When you click the pop up button, the result is a menu, so you will need to click an item of that menu - for example:
    tell pop up button 1
          click
          click menu item "Bold" of menu 1
    end tell

  • How can i remove the menu item from a menu

    how can i remove the JMenuItem from a JMenu at run time.
    thanks in advance

    This is in JMenu from the api
    void remove(JMenuItem item)
    Removes the specified menu item from this menu.
    You must download the api! it helps a lot!
    You can do that or if you need to access it again just set it visible(false);

  • How to hide/remove a menu item in Acrobat X

    Hi,
    I have a plugin created in acrobat sdk 9, running on acrobat x. I want to hide/remove the "Manage Trusted Identities" menu item, found under "Sign & certify (panel) > more sign & certify menu."
    How can i achieve this using javascript?
    thanks in advance,

    Well, I dont want users to be able to access/modify the trusted identities, so i decided to remove/hide the:
    Acrobat X > "Sign & Certify (panel)" > More sign & certify (i think its a menu) > Manage trusted identities (menu item).
    And can i hide/remove above mentioned item in any way other than javascript, like plugin code?
    Is it in any way possible to prevent user from accessing/modifying the acrobat trusted indentities?
    Thanks.

  • How to clear recents on menu items?

    When I right click on menu items,such as on pages or numbers, how can I clear recents for that menu?

    Hey, rskern, thought I'd just share the solution I finally discovered while posting on another thread about this issue. This worked for me, at least in Mountain Lion:
    If you clear the offending application from the Dock, as in drag it out of the dock, it seems to clear whatever weird cache is kept there. If you then reopen the app, and drag it in the dock so it stays there, it will update dynamically again, so when you use the "Clear Recents" menubar item, it will clear it in the Dock's menu (and Mission Control) too, even while the app is still open. Again, I just found this, so I don't know how long it'll take before that Dock menu seems to "get stuck" again, but it seems to clear it at least temporarily when you do that.
    Hope this helps!

  • HT2473 how do i remove a menu item?

    i have accidentally added a menu item into a drop down menu.
    how can i remove it?
    my thanks in advance

    If you are talking the icons in the upper right hand corner, that means holding down the command key as you drag the icon off the upper right corner off the menubar itself.  Menuitems on the left of the help menu are application preference specific.  Not all applications let you control the menubar.   Applications with in the upper right can hide the entire menubar when you click on that icon in the upper right.    To bring it back, click on in the same upper right corner.  10.7 and later have that full screen capability built-in for applications that support it.  

  • How to hide/show a menu item?

    Hi,
    Pls suggest how to do this:
    There is one book( say "one") and one page (say "two") on the portal, which are displayed to user as menu items.
    The book has two pages ( say 'a' and 'b'), which are shown in the menu dropdown of "one". I want to show the menu item "two" only if the user selects 'a' and hide it when select 'b'.
    meny item 'b' is a page with one portlet.
    Pls suggest.
    thanks

    You can implement this with backing files.
    See http://e-docs.bea.com/wlp/docs81/ipcguide/backing.html for further details.
    --Stefan                                                                                                                                                                                                                                                                           

  • How do I make top menu item unclickable but drop downs are clickable?

    I have drop down menu with the top menu item titled "Renderings" and the drop down from that are serveral types of renderings. I don't want the viewer to be taken to a page called "Renderings" when they click that, but I do what them to choose one of the drop down items. How can I make the top most menu item "Renderings" non-clickable? Thank you!

    Right mouse click on the top level page in  your plan view and then mark it as 'Include Without Hyperlink'

  • 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 [:-)

  • How to make "show all menu items" permanent?

    Does anyone know a preference setting in CS4 to make "show all menu items" enabled all the time?  I use certain menu items regularly which require the extra step of chosing "show all menu items" before they will appear in the menu.  I would love to change this irriating setting.  I have searched preferences over and over and I know there must be one that addresses it, but I cannot spot it.

    The essentials workspace should show all the menu items:
    Window>Workspace>Essentials.
    If you want a different layout or to add panels to the workspace, rearrange/add
    to the workspace (panels) and then save a new workspace under a different name.
    Window>Workspace>Save Workspace.
    MTSTUNER

  • How can I remove some menu items in the VC++ "Full featured" example that came with TestStand 3.5.

    The full featured operator interface example of VC++ contains several menus such as File, Execution, Debug, Tools, and Help.  I would like to remove or gray out some of the items base on the access privilege of the user's login.  For instance if a user login as admin, I would turn on all the features. However, if an operator login to run a test sequence, I would only provide limited menu options.

    The display of the menu items is already depending on the user's privilieges.
    1/ Modify the privileges of each user profile to enable or disable some menu accesses (Look at "Using TestStand" manual, chapter 7).
    2/ If you need to change the TestStand default behaviour, you can customize the privilieges needed to display some menu items :
    Tools menu : The items are fully customizable. You can define the privilieges needed to display them.
    Process Model : The "Enabled expressions" of the configuration and execution entry points are customizable. (->Sequence properties, "Model" tab)
    3/ Finally you can customize the operator interface to choose the menu items to display. (Look at "TestStand Reference Manual", chapter 9)
    But before you try to customize TestStand, try to explain your needs : The Operator Interface already  updates the menu items depending on the user profile.
    And an operator user has already limited menu options.
    If you need to define  more limited options, the easiest way is to customize the user privilieges of the "operator" profile.
    Bruno

Maybe you are looking for

  • Text item with a blank space

    I am trying to save a blank space in a text item but everytime i do, the item is getting trimmed. if i put in " " then it trims to null. If i put in "P " then it rtrims to "P" What am i doing wrong?

  • Forms compilation Errors under Linux

    Hello, I have a main form called Tbdoctrk.fmb. This forms compiles and runs perfectly through Oracle 9i iDS. When transfering the fmb file under Linux, and attempting to recompile using the f90genm.sh utility, I get the following compilation errors:

  • How to add Garnishment Status

    Hi, Currently in Garnishment Document (IT 0194), the status field has 7 values i.e. Active, Pending, Inactive,Released  , Reactivate for refund , Rejected ,Bankrupt. We have the requirement to add one more status (8th status option) in the garnishmen

  • Installation problems in Snow Leopard & Snow Leopard Server

    1. I have a big problem if I had to live with SL Server, whether I should install software in Administrator Account or a Standard Account(Which many people told us to create a Standard Account for better security and stability), but there are problem

  • Sync with Lotusnotes 8.5

    I have recently upgraded my lotus notes to 8.5 version. I am not able to sync lotus notes organiser with my desktop software 6.1 and hence with curve 8520. Please help.