Copy link to clipboard
Copied
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
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");
}
}
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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");
}
}
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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");
}
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now