Mobile app version of vmapp.org
Login or Join
Angela777

: 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

@Angela777

Posted in: #AdobeIndesign #Eps #Javascript #Script

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

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Angela777

2 Comments

Sorted by latest first Latest Oldest Best

 

@Cofer715

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.

10% popularity Vote Up Vote Down


 

@Sherry646

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme