: Automatically resize an object by a percentage when a particular object style is applied to it I work for an education company, and we deal with a good number of fractions when writing our
I work for an education company, and we deal with a good number of fractions when writing our publications. We currently use MathType to generate the fractions, which saves each fraction as a separate .eps file so we can place them into InDesign.
However, the fractions generated by MathType are 100% of the font we set within MathType, and we'd like for them to be scaled down a bit...say to 85% of the "base" font size.
Is there any way we can have InDesign scale down these fractions by a percentage?
Not all of the equations brought in by MathType are fractions, so we'd need a way to target just the fractions. One idea I had while writing this was to tag each of the fractions with the object style of "fraction," and then use a script to sniff out all of these and change the size by 85%. Any direction on where to go for a method like this (or another that might work) is greatly appreciated!
Thanks
More posts by @Angela777
2 Comments
Sorted by latest first Latest Oldest Best
Here is a little snippet you can run as a script:
#target indesign
var doc = app.activeDocument;
var myObjectStyle = doc.objectStyles.itemByName("fractionStyle");
var myScaleFactor = 85;
for(var i = 0; i < doc.pageItems.length; i++){
if(doc.pageItems[i].appliedObjectStyle == myObjectStyle){
doc.pageItems[i].horizontalScale = doc.pageItems[i].verticalScale = myScaleFactor;
}
}
This will loop through all page items in the document, look for the ones that have the object Style "fractionStyle" assigned to them and scale them to 85% of their original size.
Remember to set the reference point for transformations first (upper left corner) to control in which direction the scaling will happen.
Use the "Find and replace" window in Indesign (cmd+f):
Click on "find format"
Insert the info of the type you want to change, be as specific as possible: font, size, colour, weight, etc.
Go to "change format"
Insert your new font size
Click at change all
**If you are not sure your parameters are specific enough you can easily change them one by one by clicking change/find
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.