Copy link to clipboard
Copied
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
HTH
Copy link to clipboard
Copied
HTH
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Hi Laubender,
I got it.
Robert can apply remove any strokeColor, strokeWeight and export as jpeg and close file without save.
Sumit
Copy link to clipboard
Copied
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