FYI: When working on "Customising FrameMaker 12/13" I was not succesful with keyboard shortcuts for a scipt.
In the meantime I discovered Russ Wards post on this forum and his script 100.02__ADVANCED_Create_formatting_shortcuts.
So I found the reason why my shortcuts did not work: For ESC sequences the backslash must be escaped!
Then I missed the key-label in the menu. I discovered that the menu entry can be appended by a tab and the label:
oMenus.MenuDocu = "Documentation\tESC,q,d"; ... FMcalcMenu.DefineAndAddCommand(1,"docFMcalcDocu", oMenus.MenuDocu, "\\!qd");
Rick Quatro observed in the mentioned forum post that his CTRL + comma (^,) shortcut does not work. He argued that certain key combinations will not work: "I got some of the letter keys to work, but I couldn't use the punctuation keys. FrameScript still rules :-)".
I will update "Customising FrameMaker 12/13" accordingly…
I have a free script (MenuMaker) that creates and organises your menues and shortcuts.
You can sort it, activate/deactivate items, give them their own label and shortcut. And it verifies, if the shortcut is already in use.
It can be translated, but it is in German only (at the moment) and it works with "ESC" only (at the moment)
Concerning your problem above you can try this:
var Mycmd = DefineCommand(1, "Test", "Test", "^q"); Mycmd.KeyboardShortcutLabel = "ESC AB"; FMcalcMenuenu.AddCommandToMenu(Mycmd);
The magic word is "KeyboardShortcutLabel". And dividing "DefineAndAddCommand" into DefineCommand and AddCommandToMenu does the trick.
Thank you very much, Klaus!
IMHO the KeyboardShortcutLabel belongs more to the menu entry (as I did it with the TAB addendum) than to the command definition.
But now I understand why things didn't work at the beginning.