I was just chatting with Anne-Marie about this, and she told me she heard of a catalog company that put a “take 15% off all the prices on this page” sticker on every page of a big catalog because it was easier and faster than going ahead and changing the prices. But again, changing the symbol is as easy as Edit > Find/Change. Note that this script won’t change the prefix for you (changing dollars to euros, or whatever). (You can undo the math operations, but it undoes them one number at a time, which isn’t much fun if you’ve just changed a thousand numbers.) In fact, as with running any script, I strongly suggest saving your document first, in case you need to choose file > revert. It can’t handle that, and the result will require an undo. After that, it’s pretty dang fast.ĭon’t type in two prefix characters (such as -$ for negative dollars). The first time you run it, it might be slow, because it has to write a little preferences file to disk (so it remembers what you did next time you run the script). And you can constrain the operation to numbers with a particular character style. You can constrain the operation to numbers with a prefix (such as only numbers with a $ or £, or even only apply it to negative numbers by typing a dash). You can specify which math operation to perform and what to use as the operator (such as “multiply by 1.3” or “add. You can control whether the operation is performed on the entire document or just the current selection. Here’s how it works: You download the script, unzip it, install it, then double-click it in the Scripts panel (Window > Automation > Scripts). In the available operators section, you can see mathematic operations like addition (+), subtraction (-), division (/), multiplication (), percentage (). The accompanying example file, SimpleCalcExample.pdf has one example for each. This data will, of course, be different for each of the different types of calculations. The result is multiplied by B2 to get a result of 56.25 for Week 1. Select the desired calculation option: Predefined, Simplified field notation, or Custom calculation script. The values inside the parentheses calculate first, so ther value of C2 is subtracted from 1, to give us 75. (In other words, if you like it, go hire him to do some scripting the next time you need something automated.) B2 (1-C2) In this formula, 1 is equivalent to 100. It’s called NumberAdjuster, and we’re releasing it free here, as promoware. Scripting pro Steve Wareham just sent me a script that lets you multiply, divide, add, or subtract the numbers in your document. But what about all those numbers? Wouldn’t it be cool if we had a script that simply multiplied all the numbers in the document by 1.3? Too bad that’s impossible. It’s easy to do a find/change to replace the $ symbol with the ?. What if you had a document with 2,000 prices in it, all in US dollars, and you wanted to change them all to Euros? Taking a look at today’s exchange rate, we see that the dollar is around 1.3 Euros.
0 Comments
Leave a Reply. |