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

Get menu command strings

Explorer ,
Sep 11, 2016 Sep 11, 2016

I recently needed a way to fit the artboards into view and learned that I can do it using app.executeMenuCommand("fitall"). When I searched through the scripting PDFs, I've found no mention of this method.

Then I was made aware of this question [JS] CS6+  executeMenuCommand2. There are lists of commands and some links in the answers. I've visited the links and this AI CS6 `app.executeMenuCommand` was the most enlightening one as to where and how to get these commands. So I followed what the author did.

  1. Create a new document
    1. Profile: Print
    2. Size: Letter
  2. Create a new Action set
    1. Name it "My Set"
  3. Create a new Action inside the new set
    1. Name it "Fit artboard"
  4. Insert menu item
    1. Select View->Fit Artboard in Window.
    2. Click OK
  5. Save Actions to file
    1. File name is "My Set.aia"

When I examine the "My Set.aia" file, I see there are 3 parameters. The first is the menu command. The second is the name of the command. I don't know what the third is. Parameter values are in hex format. Once I convert "666974696e" into ASCII, I get "fitin", the menu command string for "Fit Artboard in Window".

/parameter-1 {

  /key 1769238125

  /showInPalette -1

  /type (ustring)

  /value [ 5

      666974696e

  ]

}

See the original and the converted action files.

I've tested this with few other commands and it seems to work. Although I couldn't make it work for "Fit All in Window". When inserting menu item in Actions, selecting View->Fit All in Window does nothing. Typing "Fit All in Window" and clicking on "Find" also doesn't work. Gives the warning "No menu item matching that name was found". Why is that?

Sigh. I wish there was an official documentation for app.executeMenuCommand() and these commands were easier to access.

TOPICS
Scripting
2.1K
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

correct answers 1 Correct answer

Community Expert , Sep 14, 2016 Sep 14, 2016

Ok. It seems to be that you are totally right.

It is not possible to record this menu command in CS6 (64-bit) and not in CS6 (32-bit). Perhaps a bug in this Illustrator version.

Translate
Adobe
Valorous Hero ,
Sep 12, 2016 Sep 12, 2016

It's just here:

[JS] CS6+ executeMenuCommand

But, that list is gotten from the .kys keyboard shortcut file of Adobe Illustrator.

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 ,
Sep 12, 2016 Sep 12, 2016

How about

/value [ 6

                666974616c6c

            ]

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
Explorer ,
Sep 12, 2016 Sep 12, 2016

Did you get it by recording "Fit All in Window" in an action? If so, how? I'm using CS6 64-bit and it doesn't record "Fit All in Window".

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 ,
Sep 12, 2016 Sep 12, 2016

akinuri schrieb:

Did you get it by recording "Fit All in Window" in an action? …

Yes.

akinuri schrieb:

…If so, how? …

How? Simply recorded.

(Tested with CS5, CC2014 and CC2015 Win)

edit:

If you cannot record the menu command, try to type the first or the first two words of the menu command in the dialog insert menu command and after than press [search]. Perhaps this helps.

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
Explorer ,
Sep 13, 2016 Sep 13, 2016

I'm using CS6 64-bit on Windows 8.1 Pro and this isn't working for me.

clip0002.gif

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 ,
Sep 13, 2016 Sep 13, 2016

Perhaps I have time tomorrow. At work we have one older Win computer with CS6 64-bit. I'll give it a try if I can.

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 ,
Sep 14, 2016 Sep 14, 2016

Ok. It seems to be that you are totally right.

It is not possible to record this menu command in CS6 (64-bit) and not in CS6 (32-bit). Perhaps a bug in this Illustrator version.

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
Explorer ,
Sep 14, 2016 Sep 14, 2016

I was afraid you'd say you recorded it just fine, which would indicate there's something wrong with my installation. And yeah, it's probably a bug. What do you suggest I do? Report it? Where do I report it?

I haven't spend much time in here or in any adobe website. I'll need directions 🙂

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 ,
Sep 14, 2016 Sep 14, 2016
LATEST

Mmhh …

I think there is no chance. CS6 is „to old“. IMHO no bugfixing more for this version.

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