Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Add Shortcut to a Window

New Here ,
Jul 08, 2008 Jul 08, 2008
I have a small problem, i hope someone can help me.
I have a Window, for that window i would like to add a ShortcutKey
(I create that with ScriptUI)

window.shortcutKey = "Ctrl + Alt + Q" for example, the problem is, every time i try to add a shortcut to window.shortcutKey i get a message "Bad Argument".
I looked in the Javascript Tool Guide but there is no example how the Argument, for example, (Ctrl+Alt+Q) should look like.

All i know is that the argument type is a String.

Thanks everyone
TOPICS
Scripting
444
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jul 08, 2008 Jul 08, 2008
You may as well assign the shortcut through the shortcut manager of Indesign. In this particular window, ask for your script in the script section to be launched with Ctrl Alt Q. OF course, I guess it's not convenient fo you because you will certainly desire the shortcut is available for any users without having to set it by hand one by one.
Loic
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 08, 2008 Jul 08, 2008
Where did you find "shortcutKey"?
According to my JS help, it's not an Indesign property for windows -- or for any object, really.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 08, 2008 Jul 08, 2008
@loic_aigon
thats what i did, thank you. I prefer the other way (the customer too)but first, it fixes the problem.
@jongware
I am beta tester for Adobe Indesign CS4 according to my extend Script Toolkit (Documentation) there is a property (shortcutKey) for the window, for Cs3 too.
I create the Gui with the ScripUI Objects.
(Window.shorcutKey = "").

Perhaps it is a new property ?

Have a nice Day.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 09, 2008 Jul 09, 2008
LATEST
>for Cs3 too.

It's not in my own InDesign JS guide, and thus (probably) not in the original ESTK2 help.
I also can't find it in the Javascript Tool Guide.

It might be a new property with CS4, or just an omission from the current (CS3) help (unlikely, the way I understand that help is built).

A bit of reverse engineering might help you out, though. Assign a shortcut to your window the usual way -- through the Keyboard Shortcut editor. Then do an "alert ("The shortcut string looks like "+yourWindow.shortcutKey)".
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines