Copy link to clipboard
Copied
i was trying to flip objects with stroke value other than zero, so i tried the below code after selecting the object
app.selection[0].absoluteFlip = Flip.HORIZONTAL;
and it worked but i want to automate this process so i tried the below code
app.findObjectPreferences = NothingEnum.nothing;
app.changeObjectPreferences = NothingEnum.nothing;
app.findObjectPreferences.strokeWeight != "0";
app.changeObjectPreferences.absoluteFlip = Flip.HORIZONTAL;
app.changeObjectPreferences.flip;
myDocument.changeObject();
but it gives error because "absoluteFlip" cant be used with "changeObjectPreferences " so what should i do
and also i dont know how to adjust settings for find object like "includeFootnotes" and "includeHiddenLayers"
the same way i do with find/replace text and grep
also i was trying to automate find and replace fonts using grep but i faced a problem with empty text frames and empty tables
i solved the text frames problem but i dont know how to do it in tables can any body help me in these two problems
Hi..
You cant use != condition directly in find preference..
use this code..
app.findObjectPreferences=app.changeObjectPreferences=null;
app.findObjectPreferences.strokeWeight=1;
myFindObj=app.findObject(true);
for(i=0;i<myFindObj.length;i++){
if(myFindObj.strokeWeight!=0){
myFindObj.flipItem(Flip.HORIZONTAL, AnchorPoint.CENTER_ANCHOR);
}
}
Copy link to clipboard
Copied
Hi..
You cant use != condition directly in find preference..
use this code..
app.findObjectPreferences=app.changeObjectPreferences=null;
app.findObjectPreferences.strokeWeight=1;
myFindObj=app.findObject(true);
for(i=0;i<myFindObj.length;i++){
if(myFindObj.strokeWeight!=0){
myFindObj.flipItem(Flip.HORIZONTAL, AnchorPoint.CENTER_ANCHOR);
}
}
Copy link to clipboard
Copied
Please remove the line 2 in the above script (app.findObjectPreferences.strokeWeight=1).. I forget to remove that.. so it will work for all cases