Added keyboard shortcuts for menu items created by the script. Is this possible?

Hi all

I wanted to create a custom script menu and assign (on the numeric keypad) shortcuts to the menu items so that I could run a script with small changes rather than change a few (currently seven) scripts separated and assign a shortcut to each of them. But now, I realized that the custom menus are not visible in the "Keyboard shortcuts" dialog box (What a disappointment!)

Am I missing something here? Or is there a workaround?

1.jpg


My idea was to trigger the main script - floating Tables.jsx - from the Manager menu item from the menu title as an argument.

var tableMenu = app.menus.item("$ID/Main").submenus.item("Table");

// "Floating Tables" sub-menu
try {
    var subMenu = tableMenu.submenus.item("Floating Tables");
    subMenu.title;
}
catch(err) {
    var subMenu = tableMenu.submenus.add("Floating Tables", LocationOptions.AT_END);
}

var topLeftAction = app.scriptMenuActions.add("Top Left");
var topLeftListener = topLeftAction.eventListeners.add("onInvoke", FloatingTablesHandler);
var topLeftMenuItem = subMenu.menuItems.add(topLeftAction);

var topCenterAction = app.scriptMenuActions.add("Top Center");
var topCenterListener = topCenterAction.eventListeners.add("onInvoke", FloatingTablesHandler);
var topCenterMenuItem = subMenu.menuItems.add(topCenterAction);

var topRightAction = app.scriptMenuActions.add("Top Right");
var topRightListener = topRightAction.eventListeners.add("onInvoke", FloatingTablesHandler);
var topRightMenuItem = subMenu.menuItems.add(topRightAction);

var bottomLeftAction = app.scriptMenuActions.add("Bottom Left");
var bottomLeftListener = bottomLeftAction.eventListeners.add("onInvoke", FloatingTablesHandler);
var bottomLeftMenuItem = subMenu.menuItems.add(bottomLeftAction);

var bottomCenterAction = app.scriptMenuActions.add("Bottom Center");
var bottomCenterListener = bottomCenterAction.eventListeners.add("onInvoke", FloatingTablesHandler);
var bottomCenterMenuItem = subMenu.menuItems.add(bottomCenterAction);

var bottomRightAction = app.scriptMenuActions.add("Bottom Right");
var bottomRightListener = bottomRightAction.eventListeners.add("onInvoke", FloatingTablesHandler);
var bottomRightMenuItem = subMenu.menuItems.add(bottomRightAction);

var backToTextAction = app.scriptMenuActions.add("Back to Text");
var backToTextListener = backToTextAction.eventListeners.add("onInvoke", FloatingTablesHandler);
var backToTextMenuItem = subMenu.menuItems.add(backToTextAction);

function FloatingTablesHandler(event) {
    var args = [event.parent.title];
    app.doScript(mainScriptFile, ScriptLanguage.JAVASCRIPT, args, UndoModes.ENTIRE_SCRIPT, "\"" + scriptName + "\" Script");
}











The main script reads the argument as follows:

alert("The argument -- " + args[0]);


If my memory is good, of Rorohiko's APID ToolKit can create "Assignable shortcut" menus I don't know this for sure at the moment because these menus a long time ago.

BTW, the question was asked here, but he has failed.

Kind regards

Kasyan

Hi Kasyan,

If what you're asking, is if it is possible to assign a keyboard

shortcut in the usual way with a menu created by a script item and then

of course, of course you can.

Add the menu item and then assign some k.shortcut you want-

you will find your menu items in the 'Scripts' category in the keyboard

Shortcuts dialog box.

Ariel

Tags: InDesign

Similar Questions

  • Y at - it a keyboard shortcut for "close all tabs in the right" and "close other tabs" actions? Thank you.

    Y at - it a keyboard shortcut for "close all tabs in the right" and "close other tabs" actions? Thank you.

    As far as I know that there is no shortcut pre-defined for this task. You can always check for the shortcut available in this list: hotkeys - quickly perform common tasks of Firefox

    However, you can set your own shortcut using this addons: https://addons.mozilla.org/en-US/firefox/addon/customizable-shortcuts/

  • Y at - it a keyboard shortcut for 'pause' and 'summary '?

    I searched carefully but did not find such a shortcut. Y at - it a keyboard shortcut for 'pause' and 'summary' on the window of LabVIEW?

    Hi Finkler,

    If you use a debugging feature! And no, there seems to be no assigned shortcut key.

    When you need a VI with the possibility of "break" you should learn about state machines. They are a common system to integrate these 'States' as a 'Performance' or 'pause' in a VI (or the program in general)...

  • Is it possible to create a keyboard shortcut for "book of the export to PDF format? (Cannot find it in the keyboard shortcuts window.)

    I would like to create a shortcut for the 'Export to the book in PDF format' command in the Panel menu books, but I can not simply find this command in keyboard shortcuts. Finding is not in what appeared to be the logical place (keyboard shortcuts > product area: Panel Menus > book), I looked at all areas of products listed on the drop-down list - but it seems that I must be missing something.

    What I do / where should I look to assign a keyboard shortcut for this command?

    Sorry, I agree that it is missing in action. I don't know of a workaround, unless someone has written a script. Scripts can be called with keystrokes.

  • Is it possible to create a keyboard SHORTCUT for a workspace in CS 5.5?

    Is it possible to create a keyboard SHORTCUT for a workspace to aid in Design CS 5.5?

    Edit menu > keyboard shortcuts > product: Menu window > Workspace Load 1st, 2nd, 3rd, etc. Create a new game and assign a shortcut

  • I'm used to be able to refresh a page by pressing the F5 key. Which doesn't seem to work. Y at - it a keyboard shortcut for editing, or I can create a?

    I'm used to be able to refresh a page by pressing the F5 key. With 4.0.1 which doesn't seem to work. Y at - it a different keyboard shortcut, or I can create a?

    Try CTRL + R

  • Keyboard shortcut for Calculator

    Hello everyone, could someone please tell me how to create a keyboard shortcut for the calculator?

    Rgds

    Roona

    Here is an MS article that may help you:

    http://support.Microsoft.com/kb/310417

    A test, I added a shortcut (Ctrl + Alt + G) to my computer and it works fine.

    It also forces me to reach upward, my touchpad and perform sequences of keys or use both hands, and I'm lazy.

    A 'shortened' shorter that I would use would be to simply add the calculator to Quick Launch area (to the immediate right of the Start button), and then I could enter calculator with just a simple mouse click.

    What you see in the quick launch area is really just a file specific to each user, you can access the folder and add more shortcuts and remove shortcuts easily.  I deleted those that XP put there for me since I use them, but I can always add back them.

    You must activate the QL area, if it isn't already.

    For user Jose, my Quick Launch folder is here:

    C:\Documents and Settings\Jose\Application Data\Microsoft\Internet Explorer\Quick Launch

    In my region of QL, I put things that I use all the time... Firefox, Chrome, Outlook, office, Services, event viewer...  I might add calculator if I wanted to.  You can drag and drop things directly on the QL area, but be careful not to slide completely off you menu accessories - it is best to copy and paste.  If you accidentally drag it off your Accessories menu, just bring him back and drop it back where it belongs.

    Then, all these things that I use all the time are a simple mouse click whenever I want that they (don't double-click them).

  • Keyboard shortcuts for the video Composite and Audio Waveform

    I work in Premiere Pro CS6 on Mac OS 10.10.5. I am constantly switch between views video Composite and Audio Waveform in the Source monitor Panel. To do this, I have to use the mouse to click on the key icon, and then select one of the points just at the top of the context menu. My workflow would be so much faster if there was a keyboard shortcut.

    The official page of default keyboard shortcuts indicates no shortcut for these menu items. Mac OS system preferences > keyboard > shortcuts [shortcuts App] allows me to create shortcuts for application specific menu items, but not for context menus.

    Is there, however, a way that I can tell Premiere Pro CS6 to use a keyboard shortcut for the video Composite and Audio Waveform views?

    You can create your own... If you scroll the list link you to that, there is the Source section of monitor... which has options short keyboard available for your two wishes:

    Then, use Cmd / Alt + K to do your editing of the keyboard shorts... Scroll way down to find this section, then create a short. At the bottom, it will tell you if it comes into conflict with one another. Here I come to make Composite video, abbreviated as CC2015.2:

    By clicking on the line to the right of the effect you want to order makes these empty lines appear the "x" you will see in this view... click again and you can start typing your proposed short. If your entry on this line is already in use, will appear this very practical warning:

    So... do you some useful shorts!

    Neil

  • Adding keyboard shortcuts

    Is it possible to create a keyboard shortcut for the menu of the application that has submenus?  E example for the file menu of Pages command export to PDF (submenu)...  It doesn't seem to work.

    IF submenus are all unique, you should only need to use what is in the submenu.

    If it is not or is still not working, someone posted a solution last year. I think it was the chain at each level in the hierarchy of menus linked to something like ->

  • Keyboard shortcut for "automatic adjustment"?

    Well, my previous question was how to hide the controls of the workstation, it is how to adjust automatically to work without having to use the "Display" commands  Is there a keyboard shortcut for this?  Now that I can expand my computer window because the controls are hidden, the guest operating system window enlarges not inside the frame as soon as I expanded the framework.  So I just get black spaces within the framework where I the Office of OS client to expand and Fill in automatically.

    I would normally use Autofit for this, but the control is hidden.  Now the normal thing would be to have an "Accelerator" keyboard to adjust automatically, but still, I don't see it.

    Y at - it no help for it?

    Thank you.

    -Roger

    "Autofit Guest" and "Autofit Window" are persistent parameters.  If you select "Autofit Guest", then you can (with VMware Tools) should always resize when you resize the window.  There is not much to gain by having keyboard shortcuts for them because you should not be disabling them frequently.

    A keyboard shortcut for "Fit Guest Now" would be more useful (and I guess that's what you're referring in fact), but, no, there is no shortcut for that either. (What you see in the menus, it's what you get). If you really want you can try to do an editor resources (e.g., Resource Hacker), vmware.exe of opening and editing of the accelerator table to add a shortcut key for the menu item 'Fit Guest Now', but this isn't something that we can support.

  • Keyboard shortcuts for the buttons works irregularly - why?

    When you use the access key for the button attributes, they work sometimes and not others. Three behaviors are observed:

    -use the accesskey times moves the focus and click on the button (correct behavior)

    -use the access key moves the focus only - do not by clicking on the button

    -use the accesskey does nothing

    These problems occur without change installation, restart, etc..

    What could cause this?

    Moreover, 3.6.28 works very well with the exact same web application.

    It might be useful to have a small script for conducting a census of the keyboard shortcuts page. You can open the web console (Ctrl + Shift + k), paste the following options next to the circumflex accent ("' >" ") and press ENTER. A new element is added at the end of the body with the results.

    var aks=document.querySelectorAll("a[accesskey], button[accesskey], input[accesskey]"); var out=document.createElement("pre"); for(var i=0; i<aks.length; i++) out.appendChild(document.createTextNode("Tag:'"+aks[i].nodeName+"'; id:'"+aks[i].id+"'; name:'"+aks[i].name+"'; key:'"+aks[i].getAttribute("accesskey")+"'\n")); document.body.appendChild(out);
    
  • keyboard shortcut for a retail setting "preferences".

    A few sites I use often are difficult to read in their own colors, then I go to 'Edit-> Preferences-> content-> colors' and uncheck "Allow pages to choose their own colors, instead of my selections above".
    Other sites need this setting checked in order to work correctly.
    I can create a keyboard shortcut for this setting?

    FF 4.0.1 on Windows XP and Linux

    Specifically for this and because it can be changed via the options, you can create a toolbar button to do this.

    Manufacturer of custom toolbar buttons , select "Enable/disable Page colors", install, move the button custom toolbar. Active / disable preferences, removes some but not all images (loses the banner entire mozillaZine exactly the same as the preference). Another button that can be included is 'Font of Page', which activates / turns off page fonts between your colors and colors on the web page. Another button which may be necessary to read some pages is "Toggle Styles" to disable CSS styles or save on.

    See also the page where the above come, other suggestions:

    Please mark "resolved" a response that will better help others with a similar problem - hope it was her.

  • Keyboard shortcut for the letter M

    Hello

    My letter does not any more long (the incident). Everything is fine so I don't want to replace the keyboard (it's a laptop). I can create a keyboard shortcut for the letter "m"?
    I am running windows 7.
    Thank you!

    Saturday, September 15, 2012 22:39:15 + 0000, reg45 wrote:

    Hello
    My letter does not any more long (the incident). Everything is fine so I don't want to replace the keyboard (it's a laptop). I can create a keyboard shortcut for the letter "m"?
    I am running windows 7.

    See your other answers, but note also that you can use a program such as
    the free Sharpkeys
    (http://www.randyrants.com/2011/12/sharpkeys_35.html) to change a key
    whether you never (maybe Caps Lock) to m.
    Ken Blake, Microsoft MVP

  • Keyboard shortcut for an Export Preset Custom question

    Here's my question that I can't find an answer in the forum.

    I'm in grid mode, I use the painter to the gun to paint on the presets.  Now I have a single predefined custom export image I would like to use to export the images I added a custom wait - all by keyboard shortcut.

    Is it possible to use a keyboard shortcut to apply to a custom preset?

    I do not see that you can use the keyboard shortcut for 'export' previous and I see that I can right click and down to my presets, but I would like to be able to select my specific predefined export and apply a keyboard shortcut to this one in particular.   Is there a way?

    (When I try to use export with previous for some reason, it seems by default not preset I wish.)

    I use Lightroom 5; on a mac.

    I really like the features of Premiere Pro or Photoshop where you can shortcuts for custom game, can this feature please be brought to Lightroom?  Or maybe there is already and I'm missing?  Thanks for the help

    There is no provision to customize keyboard shortcuts in Lightroom.  The option "export with previous" refers to the previous export Setup, not the last develop used preset.

  • Keyboard shortcuts for "edit multiple images", "onion all the", "brush size"?

    Assign a keyboard shortcut for the button 'edit multiple images' and setting options of onion skin?
    I don't see these options anywhere in the high standards of Flash menus.
    These are the buttons that I'm talking about:

    Untitled-1.png

    Also, what about a keyboard shortcut for adjustment brush sizes?

    The only way I can understand how defining this is in the drop-down list of the Toolbox.

    There are no shortcuts for those so you would need to add new commands to the context menu and then add a new shortcut for this command and I don't think you can do the first.

Maybe you are looking for

  • cannot open new tabs on firefox 24. + sign does not nor do 'file '-&gt;' new tab '.

    OS: win 7Update Firefox 23 to 24. Since then, I can't create new tabs though when I navigate to 'close the tabs right' it displays correctly the number of tabs, I tried to create and close. He however open tabs from links.

  • cannot answer calls without closing messages

    I am unable to respond to calls when an SMS or an email came. I tried to change all my alert settings, and it makes no difference, I can't always answer a call without closing all unread messages and emails. any suggestions?

  • Error loading of HCI and SCI load error

    I have a Tecra A9 and have recently updated the BIOS v2.10 I reinstalled the added value pack, but when I try to run the Setup of HW in the Toshiba Utilities in the start menu folder, I get "HCI load error!" then followed "SCI load error!" but it put

  • T410 DVD player

    Hi, I recently bought a Thinkpad T410 and I want to create recovery discs. so I bougt garage some DVD + R discs and tried to create discs for you, but it seems that the DVD player does not support these discs or cannot write. Is it possible that thes

  • Everybody put in place Service Documents Cloud integration in the last update of PC?

    Hi allJust having a little trouble of finger implementing integration with DOCS of PCS.  There is also the corollary of this, and which is setting up a PC of DOCS integration - you can do a similar set in DOCS.  This leads to a few more questions:You