Skip to main content
Known Participant
May 5, 2015
Answered

Menu Commands Outline Stroke

  • May 5, 2015
  • 4 replies
  • 3371 views

Hello Everyone,

I am trying to find an outline stroke menu command (without a diolog box popping up)

app.executeMenuCommand ('Expand3') Works, but I am trying to see if there is a way to avoid the dialog box.

app.executeMenuCommand ('Outline Stroke')

app.executeMenuCommand ('OutlineStroke')

app.executeMenuCommand ('outlineStroke')

app.executeMenuCommand ('outline Stroke')

app.executeMenuCommand ('outline stroke')

None of those seem to work. Also, if there is an official reference somewhere for all the menu commands that would be helpful as well.

Thanks guys!

This topic has been closed for replies.
Correct answer Ten A

Hi,

Try below:

app.executeMenuCommand ('OffsetPath v22');

Ten

4 replies

Known Participant
May 11, 2015

Thanks for everyone that responded, you all found solutions so I wish I could give everyone correct answer points. And Quertyfly, the way you were able to create and load an action with your script was really cool, If I can figure out what and how the heck you did it would really open up a lot more possibilities for me.

Qwertyfly___
Legend
May 11, 2015

The real praise goes to moluapple‌.

[Illustrator]Create, load and execute action all by JS only

the trick is to create the action manually. then save it.

the saved file contains all the info you need.

combine that with the above script and your away.

Silly-V
Legend
May 12, 2015

And, maybe one day they will let scripting access more of the action panel, such as really letting us detect if the right actions are there!

Ten A
Community Expert
Ten ACommunity ExpertCorrect answer
Community Expert
May 11, 2015

Hi,

Try below:

app.executeMenuCommand ('OffsetPath v22');

Ten

Qwertyfly___
Legend
May 11, 2015

That makes no sense at all, why would OffsetPath do an OutlineStroke!

But it works, I would never have thought to try that.

so:

app.executeMenuCommand ('OffsetPath v22'); = Outline Stroke

app.executeMenuCommand ('OffsetPath v23'); = Offset Path


Silly-V
Legend
May 11, 2015

It's right up there with Planet X, I wonder how everyone ends up figuring these things out over time!

Silly-V
Legend
May 8, 2015

Another way to do it is to use a "Create Outline" effect and then use an "expandStyle" command right afterwards.

    app.executeMenuCommand('Live Outline Stroke');

    app.executeMenuCommand('expandStyle');

Qwertyfly...‌ : when an action is not present, but it is commanded to play, and UserInteractionLevel is DONTDISPLAYALERTS, it seems to not even run the catch block. So, I wonder if the way a script can even tell that there was en error is because the Action error dialog pops up. When they are suppressed, the script seems oblivious.

I think pressing Stop once is a reasonable solution, given our luck of the draw with Actions.

Qwertyfly___
Legend
May 9, 2015

‌i spent a little time trying to work around it but had not luck.

I'll think on it some more at some point. There may be some work around not yet explored.

Qwertyfly___
Legend
May 6, 2015

// - - - IMPORTANT - - -

// on First run you will get a popup dialog.

// YOU MUST PRESS "STOP" for the action to be created...

// CS6 and beyond only

// Credit for the meat of this must go to moluapple

// https://gist.github.com/moluapple/2568405

//

// Qwertyfly 6-5-15

//

// - - - IMPORTANT - - -

// on First run you will get a popup dialog.

// YOU MUST PRESS "STOP" for the action to be created...

//

var actionStr = ['/version 3',

    '/name [ 12',

    '536372697074416374696f6e',

    ']',

    '/isOpen 1',

    '/actionCount 1',

    '/action-1 {',

    '/name [ 12',

    '457870616e645374726f6b65',

    ']',

    '/keyIndex 0',

    '/colorIndex 0',

    '/isOpen 1',

    '/eventCount 1',

    '/event-1 {',

    '/useRulersIn1stQuadrant 0',

    '/internalName (ai_plugin_expand)',

    '/localizedName [ 6',

    '457870616e64',

    ']',

    '/isOpen 0',

    '/isOn 1',

    '/hasDialog 1',

    '/showDialog 0',

    '/parameterCount 4',

    '/parameter-1 {',

    '/key 1868720756',

    '/showInPalette -1',

    '/type (boolean)',

    '/value 0',

    '}',

    '/parameter-2 {',

    '/key 1718185068',

    '/showInPalette -1',

    '/type (boolean)',

    '/value 0',

    '}',

    '/parameter-3 {',

    '/key 1937011307',

    '/showInPalette -1',

    '/type (boolean)',

    '/value 1',

    '}',

    '/parameter-4 {',

    '/key 1936553064',

    '/showInPalette -1',

    '/type (boolean)',

    '/value 0',

    '}',

    '}',

    '}'].join('\n');

try {

    app.doScript('ExpandStroke', 'ScriptAction');

} catch(e) {

    createAction(actionStr);

    app.doScript('ExpandStroke', 'ScriptAction');

}

function createAction (str) {

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

    f.open('w');

    f.write(str);

    f.close();

    app.loadAction(f);

    f.remove();

}