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

[JS]: Accessing Menu Items in CS6

New Here ,
Jul 16, 2012 Jul 16, 2012

Copy link to clipboard

Copied

Hi,

So I just got CS6, and I'm wondering how I access menu items using Javascript?

Also, I'm looking at the CS6 JS reference, and it doesn't say whether app.activeDocument.selection is Read-Only. Hopefully not, because I would need this for my purposes in accessing the menu.

The item I wanna access is Select > Same > Stroke Color. Seems simple enough. Any help would be appreciated!

TOPICS
Scripting

Views

3.6K

Translate

Translate

Report

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

correct answers 1 Correct answer

Enthusiast , Jul 16, 2012 Jul 16, 2012

I have discovered a list myself, see https://gist.github.com/2719021, more info: http://goo.gl/EYBwa (Chinese)

For what you need is : app.executeMenuCommand('Find Stroke Color menu item');

Votes

Translate

Translate
Adobe
Enthusiast ,
Jul 16, 2012 Jul 16, 2012

Copy link to clipboard

Copied

I have discovered a list myself, see https://gist.github.com/2719021, more info: http://goo.gl/EYBwa (Chinese)

For what you need is : app.executeMenuCommand('Find Stroke Color menu item');

Votes

Translate

Translate

Report

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 18, 2012 Jul 18, 2012

Copy link to clipboard

Copied

Thanks so much! I couldn't find this anywhere! You'd think that as a new feature Adobe would maybe make the information about it more accesible! Thanks again

Votes

Translate

Translate

Report

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
Enthusiast ,
Jul 18, 2012 Jul 18, 2012

Copy link to clipboard

Copied

You are welcome.

Let me explain a bit (in English) how I know that. The point is that the underlying menu item name is recorded in action when you insert menu item into it. It's not recorded as normal string but as hex value, so I convert and get it.

Votes

Translate

Translate

Report

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
Valorous Hero ,
Jul 19, 2012 Jul 19, 2012

Copy link to clipboard

Copied

You can find the Menu Shortcut Hotkeys text file and use the menu comman strings there.  The .kys file should be located in the installation directory under Presets.

Votes

Translate

Translate

Report

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
Enthusiast ,
Jul 19, 2012 Jul 19, 2012

Copy link to clipboard

Copied

LATEST

Thanks! However, that is useful but not always good luck.

For example, "Drop Shadow" menu can be found twice in the .kys file, but none of these string is valid for app.executeMenuCommand(), the right string is "Live Adobe Drop Shadow".

And another, "OffsetPath2" will not work, the right one is "OffsetPath v22". And so on...

After some discoveries, I think menu strings in the .kys file that contain "\" will always work well.

Votes

Translate

Translate

Report

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