Applescript / Javascript > Adobe Illustrator scripting

Line Segment

(1/1)

norbert_ds:
Hi,

I'm finding it very difficult redaing the documentation for Illustrator.

Can anybody help me figure out how I could change the properties of a selected line segment especially stroke weight?

Regards
Norbert

Publi-Script:
Hi Norbert,

Would this help?


--- Quote ---001     tell application "Adobe Illustrator"
002          activate
003          tell document 1
004               tell path item 1
005                    set stroke width to 4
006               end tell
007          end tell
008     end tell

--- End quote ---

or

--- Quote ---001     tell application "Adobe Illustrator"
002          activate
003          tell document 1
004               tell (every path item whose selected is true)
005                    set stroke width to 2
006               end tell
007          end tell
008     end tell

--- End quote ---

norbert_ds:
Thanks for your reply.

I'm sorry I should have mentioned that I am more familiar with Javascripting than Applescript or Visual Basic Scripting

Regards
Norbert

larsen67:
This should be close (but No cigar) from the guide. I have something wrong because I get a dialog but when clearing it it works may be you know how to sort that?

//Declare and initialize variables
var msgType = "";
// check if a document is open in Illustrator.
if (app.documents.length > 0)
{
// check if a document has selected items.
mySelection = app.activeDocument.selection;
if (mySelection.length > 0)
{
for (var i=0; i<mySelection.length; i++)
if (mySelection.typename = PathItem){
var PathRef = mySelection;
PathRef.strokeWidth = 20;
}
}
else {
// Document has NO selected Path Items.
msgType = "No Path Items are selected.";
}
}
else {
// No document is open.
msgType = "No Document Open.";
}
alert( msgType );

Navigation

[0] Message Index

Go to full version