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

Outline stroke with Illustrator scripting

New Here ,
Mar 17, 2014 Mar 17, 2014

Hello everybody!

I'm making a script. I need to do the outline stroke action. I can't find it in the extendscript anywhere.

I can do it from a applescript and call it from my extendscript in CS6 BUT I need my script to run CS5.5 and run on a windows machine:

tell application "System Events"

    click menu item "All" of menu "Select" of menu bar item "Select" of menu bar 1 of process "Adobe Illustrator"

      

    click menu item "Outline Stroke" of menu "Path" of menu item "Path" of menu "Object" of menu bar item "Object" of menu bar 1 of process "Adobe Illustrator"

I have also found a way to do this in CS6 (app.executeMenuCommand ('Live Outline Stroke'))  but i havent got it working yet. And its for CS6+ so I can't really use it if I cant force my users to upgrade

Anyone out there with an answer? It would help me alot. As I understand it you can call functions withing extensionscript if you have the right "action code" for it. Using the ActionDescriptor.

 var desc3 = new ActionDescriptor();

I have looked around and I cant find any documentation with a complete reference with the action codes. Do any one of you out there the action code for "Outline stroke"?

Thanks so much for your answer and effort.

Regards,

Ruy Ramos

TOPICS
Scripting
4.7K
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 29, 2023 Sep 29, 2023

just in case someone else is looking for a solution...

should work in Ai 2015 and up:

 

 

#target illustrator
app.executeMenuCommand("selectall");
var doc = activeDocument; 
var sel = doc.selection;
if (sel.length > 0) {
   for (var i=0; i<sel.length; i++) {
      app.executeMenuCommand("OffsetPath v22");  
   }
}

 

  

Translate
Adobe
Community Expert ,
Mar 17, 2014 Mar 17, 2014

playing Actions and executing Menu Commands debuted in CS6.

For CS5 you're out of luck, you're stuck with Applescript for playing actions

ActionDescriptor() is not illustrator, it might be Photoshop.

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
Guru ,
Mar 20, 2014 Mar 20, 2014

Yup it's PS… That app has 'action manager' code. You can even use a plug-in to record it and utilise. Alas not with AI.

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 ,
Mar 23, 2014 Mar 23, 2014

have fun

// select objects, which you want to tranform/expand. 

#target illustrator

app.executeMenuCommand("selectall");

var doc = activeDocument;

var sel = doc.selection;

if (sel.length > 0) {

   for (var i=0; i<sel.length; i++) {

        app.executeMenuCommand("Expand3");

       }

   }

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 ,
Mar 24, 2014 Mar 24, 2014

Hello,

Thank you for this!! My question now is, is it possible to do this comand without the UI coming up?

I tried to set:

UserInteractionLevel.DONTDISPLAYALERTS

but nothing changes.

Do you know where there is a list of all the menucomands?

Thanks again

Regards,

Ruy Ramos

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 29, 2023 Sep 29, 2023
LATEST

just in case someone else is looking for a solution...

should work in Ai 2015 and up:

 

 

#target illustrator
app.executeMenuCommand("selectall");
var doc = activeDocument; 
var sel = doc.selection;
if (sel.length > 0) {
   for (var i=0; i<sel.length; i++) {
      app.executeMenuCommand("OffsetPath v22");  
   }
}

 

  

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