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

How can i change rectangle contour

Participant ,
Mar 29, 2017 Mar 29, 2017

Hi

How can I change rectangle or other object contorus using javascript?

And another question:

How can i read frame paramethers( for example thickness)

Thanks

TOPICS
Scripting
987
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

Guide , Mar 29, 2017 Mar 29, 2017

HTH

Screen Shot 2017-03-30 at 11.45.28 AM.png

Translate
Guide ,
Mar 29, 2017 Mar 29, 2017

HTH

Screen Shot 2017-03-30 at 11.45.28 AM.png

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
Engaged ,
Mar 30, 2017 Mar 30, 2017

Robert,

I think your requirement is, you wanted to search any object stroke weight and change with new stroke weight.

var doc = app.documents[0];

var myOldStrokeWeight = 1;// find stroke weight

var myNewStrokeWeight = 5;// change stroke weight

changeStrokeWeight ();

function changeStrokeWeight(){

  var page = doc.pages;

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

  var myPage = page;

  for(j=0; j<myPage.pageItems.length; j++){

  var myObj = myPage.pageItems;

  if(myObj.strokeWeight == myOldStrokeWeight){

  myObj.strokeWeight = myNewStrokeWeight;

  }

  }

  }

}

Sumit

-Sumit
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 ,
Mar 30, 2017 Mar 30, 2017

Hi Sumit,

don't think so. See this thread, that could be related:

Save frame as jpg whthout contour

Where Robert wants to set the strokeWeight to 0 and later back to the initial value after exporting frames to JPEG.

That would be "dangerous" as I discussed there.

The values for:

StrokeAlignment
StrokeColor
StrokeDashAndGap
StrokeType

etc.pp.

could be set back to default that i.a. is governed by the activated object style in the Object Styles panel.
So you could either strore the values of the properties mentioned above or do the export on a duplicate you can later throw away.

Regards,
Uwe

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
Engaged ,
Apr 14, 2017 Apr 14, 2017

Hi Laubender,

I got it.

Robert can apply remove any strokeColor, strokeWeight and export as jpeg and close file without save.

Sumit

-Sumit
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 ,
Apr 14, 2017 Apr 14, 2017
LATEST

Hi Sumit,

saving the document before doing anything, exporting to JPEG after setting the stroke weight to 0, closing without saving and reopening the document is also a valid option. I'd prefer to export from duplicated items where the stroke weight is set to 0 and throw away the duplicates.

Regards,
Uwe

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