Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


[JS] CS6+ executeMenuCommand

Adobe Community Professional ,
Feb 12, 2014 Feb 12, 2014

Copy link to clipboard

Copied

Hello together,

since CS6+ there is possible to

executeMenuCommand (menuCommandString: string)

Executes a menu command using the menu shortcut string.

Question 1:

Who knows a way to read all the available commands?

Question 2:

At the time I need 'Clear Guides'

app.executeMenuCommand ('Clear Guides')

app.executeMenuCommand ('Clear guides')

app.executeMenuCommand ('clear Guides')

app.executeMenuCommand ('ClearGuides')

app.executeMenuCommand ('clear guides')

and other variants doesn't work.

Who know the right syntax? (Or is this menu command not available????)

Any help is appreciated. (Additional: I know the way to use app.doScript (myAction) - but this is not part of my questions)

TOPICS
Scripting

Views

62.4K

Likes

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 2 Correct answers

Adobe Community Professional , Feb 12, 2014 Feb 12, 2014
tryapp.executeMenuCommand ('clearguide')and let us know if it works, I don't have CS6 to try

Likes

Translate

Translate
Explorer , Mar 12, 2014 Mar 12, 2014
Hi guys,I am posting almost complete list of menu commands. Already removed plugin-like commands which does not work at all. Some of the entries are still to be confirmed. There are some entries like for eg. AdobeLayerPalette:- AdobeLayerPalette1 - show on/off layers window- AdobeLayerPalette2 - create new layer with no dialog popup- AdobeLayerPalette3 - create new layer with dialog popupor - AdobeNavigator1 - does not work- AdobeNavigator2 - does not work as well- AdobeNavigator - show on/off n...

Likes

Translate

Translate
Adobe Community Professional ,
Dec 30, 2016 Dec 30, 2016

Copy link to clipboard

Copied

Adding:

app.executeMenuCommand('selectall');

app.executeMenuCommand('deselectall');

app.executeMenuCommand('selectallinartboard');

And furthermore:

CarlosCanto schrieb:

these are my findings

  1. SelectionHat1//SelectDirectionHandles
  2. SelectionHat10//saveselection...(dialog)
  3. SelectionHat11//editselection...(dialog)
  4. SelectionHat12//SelectObjectsNotAlignedtoPixelGrid
  5. SelectionHat2//ObjectArrangeSendtocurrentlayer
  6. SelectionHat3//selectallonsamelayer
  7. SelectionHat4//hideallartworkAbove
  8. SelectionHat5//lockallartworkAbove(andtouchingselectedart)thisisgreatitdoesHitTesttoknowwhat'saboveandtouching
  9. SelectionHat6//hideotherlayers
  10. SelectionHat7//lockotherlayers
  11. SelectionHat8//Select->NextObjectAbove(stackingorder)
  12. SelectionHat9//Select->NextObjectBelow(stackingorder)

A

Likes

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
Adobe Community Professional ,
Dec 07, 2017 Dec 07, 2017

Copy link to clipboard

Copied

Here is a updated list for ver.22.

Illustrator CC(ver.22) menu commands list | CC Labo

Likes

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
Adobe Community Professional ,
Dec 08, 2017 Dec 08, 2017

Copy link to clipboard

Copied

What is the "Create Eve Dialog"?

Likes

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
Adobe Community Professional ,
Dec 08, 2017 Dec 08, 2017

Copy link to clipboard

Copied

Thank you for your notify.

Its used in debug environment and I removed it from list.

Likes

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
Adobe Community Professional ,
Dec 11, 2017 Dec 11, 2017

Copy link to clipboard

Copied

So it did not do anything?

Likes

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
Adobe Community Professional ,
Dec 11, 2017 Dec 11, 2017

Copy link to clipboard

Copied

Yes, It's used in native SDK. we can't use it in ExtendScript.

Likes

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
Adobe Community Professional ,
Dec 08, 2017 Dec 08, 2017

Copy link to clipboard

Copied

thanks Ten, is there anything new and exiting?

Likes

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
Adobe Community Professional ,
Dec 08, 2017 Dec 08, 2017

Copy link to clipboard

Copied

I included a few things that were not listed in the previous list like Photoshop plugins and some panels under the windows menu.

And removed around legacy text conversions because of their not work correctly.

Likes

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
Participant ,
Sep 01, 2015 Sep 01, 2015

Copy link to clipboard

Copied

You don't know a way to set the amount that it needs to offset do you? Rather than the UI to enter the amount?

-Boyd

Likes

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
Guide ,
Sep 01, 2015 Sep 01, 2015

Copy link to clipboard

Copied

the executeMenuCommand is like you have just clicked the menu item.

so you cannot bypass the UI using this method.

can be done via an action.

action can be created , Run and destroyed via javascript

this example will work. just be careful as it does not have any safeguards.

ie,  var f = new File('~/ScriptAction.aia');  will overwrite any file of that name in that location. then the script removes the file deleting it from your system.

if you had a file of that name in that location then ... bad luck...

and does not check if action of that name exists etc...

function offset_item_via_action(){

    // Set your offset distance here

    var Offset = "25.0";

    //

    if(app.documents.length = 0){return;}

    var ActionString = [

'/version 3',

'/name [ 16',

  '53637269707465645f416374696f6e73',

']',

'/isOpen 1',

'/actionCount 1',

'/action-1 {',

  '/name [ 13',

  '4f66667365745f416374696f6e',

  ']',

' /keyIndex 0',

  '/colorIndex 0',

' /isOpen 1',

  '/eventCount 1',

' /event-1 {',

  '/useRulersIn1stQuadrant 0',

' /internalName (ai_plugin_offset)',

  '/localizedName [ 11',

  '4f66667365742050617468',

  ']',

' /isOpen 1',

  '/isOn 1',

' /hasDialog 1',

  '/showDialog 0',

' /parameterCount 3',

  '/parameter-1 {',

  '/key 1868985204',

' /showInPalette -1',

  '/type (unit real)',

' /value ' + Offset + '',

  '/unit 592476268',

  '}',

' /parameter-2 {',

  '/key 1835627634',

' /showInPalette -1',

  '/type (real)',

' /value 4.0',

  '}',

' /parameter-3 {',

  '/key 1785623664',

' /showInPalette -1',

  '/type (enumerated)',

' /name [ 5',

  '4d69746572',

  ']',

  '/value 2',

  '}',

  '}',

'}'

    ].join('\n');

    createAction(ActionString);

    var ActionString = null;

    app.doScript("Offset_Action", "Scripted_Actions", false);

    app.unloadAction("Scripted_Actions","");

    function createAction (str) {

        var f = new File('~/ScriptAction.aia');

        f.open('w');

        f.write(str);

        f.close();

        app.loadAction(f);

        f.remove();

    }

}

offset_item_via_action();

Likes

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
Community Beginner ,
Jan 22, 2018 Jan 22, 2018

Copy link to clipboard

Copied

Is it possible to pass parameters to a Effect? say, an Effect->Distort->Roughen?
I would like to randomize parameters for, e.g., each path.

Likes

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
Adobe Community Professional ,
Jan 22, 2018 Jan 22, 2018

Copy link to clipboard

Copied

no, not possible but you can use applyEffect()

check these threads for more info

Re: PageItem.applyEffect(LiveEffectXML)

Re: Applying Live effects (offset path) in Illustrator using AS

Likes

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
Adobe Community Professional ,
Jan 22, 2018 Jan 22, 2018

Copy link to clipboard

Copied

Carlos speeds past me to the finish line!

I was gonna say: read this:

Re: PageItem.applyEffect(LiveEffectXML)

Likes

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
Adobe Community Professional ,
Apr 03, 2021 Apr 03, 2021

Copy link to clipboard

Copied

LATEST

Only as a small addition.

How to get the name for a specific menu command (if not already listed):

 

pixxxelschubser_0-1617482620096.png

Thank you so much!!

 

I'm still baffled at how badly Adobe has documented their stuff (and the lack of tutorials they provide)!

Any idea where I could find the latest menu commands list (for Illustrator CC 2020)?

 

From your links and this post (https://community.adobe.com/t5/illustrator/get-menu-command-strings/m-p/8539169?page=1#M216220), I found a way to get the menu command:

(Explained here for future lost programmers 😉 )

1) Create a new Action set

2) Then choose "Insert Menu Item"

3) Search for the right menu item and add it to the action set.

4) Click "Save Actions" from the small menu in the Action panel

5) Open the saved .aia file in some text editor

6) Find the 'event', in my case it was under "/event-2 {"

7) In my case '/parameter-1' had a '/value' of "4c6976652041646f62652050534c20476175737369616e20426c7572"

8) Convert that value from HEX to ASCII (I used: https://www.rapidtables.com/convert/number/hex-to-ascii.html) and get the menu command. In this case "Live Adobe PSL Gaussian Blur". (Which worked when used in Illustrator CC 2020.)

 

I still get the popup dialog with the options to adjust. So if anyone knows how to set these and skip the dialog, that would be awesome !


By @philipv71883047

                                                                                       --> jump to quoted post

 




Likes

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
    • 1
    • 2