Author Topic: Line Segment  (Read 2282 times)

0 Members and 1 Guest are viewing this topic.

Offline norbert_ds

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Line Segment
« on: September 09, 2008, 07:20:50 PM »
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

Offline Publi-Script

  • Administrator
  • Hero Member
  • *****
  • Posts: 596
  • Karma: 16
  • Gender: Male
  • Automate your Life!
    • Publi-Script.com
Re: Line Segment
« Reply #1 on: September 10, 2008, 07:59:46 AM »
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

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
« Last Edit: September 10, 2008, 08:02:45 AM by Publi-Script »
Michel Lemieux
Forum Administrator
-------------------------
OS X 10.6.4
Quark 6.5 / 7.5 / 8.1.6
Adobe Design Premium CS / CS2 / CS3 / CS4 / CS5
Script Debugger 4.5

Offline norbert_ds

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Line Segment
« Reply #2 on: September 11, 2008, 10:56:41 PM »
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

Offline larsen67

  • Sr. Member
  • ****
  • Posts: 459
  • Karma: 10
  • Gender: Male
Re: Line Segment
« Reply #3 on: September 15, 2008, 08:03:26 AM »
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 );