Automatically update prices in a indesign document
Home › Forums › InDesign Add-ons (Scripts, Scripting, and Plug-ins) › Automatically update prices in a indesign document
November 13, 2017 at 3:15 am #99568
Im new to the world of Indesign and scripts, and i’ve got the task at my current job to update/create a new pricelist.
Therefore I am exploring Indesign and I’ve come across the “Number adjustment” script – although I’ve managed to download it and save it correctly, but i simply can’t get it to work.
Do I have to setup my Indesign document in a special way? I.E Import a structure from Excel or can I simply write the prices as a text (insert table tool in Indesign) and the script will be able to pick this up and multiply (this is what i will need in the years to come).
I know this might be an awful explanation, if more information is required – please be so kind as to say what I need to post (remember im a noob, and don’t really know the scripting language – scripting for dummies appreciated).
November 13, 2017 at 7:10 am #99570
Not clear! … ;-)
What do you really want to play? Adjust existing prices? Play modifications with an Excel prices corresponding table [3 columns: SKU | previous price | new price]?
Not a same matter! Not a same script!
November 13, 2017 at 8:53 am #99571
In general, you do not need to do anything special with the script. Just double-click it and a dialog box appears. By default it adjust all the numbers (so sometimes you need to specify what kind of numbers you want to change). When you say it does not work, what happens?
November 13, 2017 at 9:02 am #99572
“When you say it does not work, what happens?” …
I suppose: “Nothing!” =D
November 14, 2017 at 1:27 am #99596
As I suspected, bad explanation.
I am looking to build up a pricelist in Indesign from scratch, with the possibility to adjust these prices by a percentage later on.
When I run the script nothing happens, as if it can’t locate the numbers in the document
Here’s an example on how the numbers are written in the pricelist: 6.234,00
November 14, 2017 at 8:28 am #99602
Are you using the 1_2″ version of the script from this article? https://indesignsecrets.com/free-script-to-change-all-numbers-in-a-document-using-math.php
When you double-click the script, you should see a dialog box appear that looks like this:
Do you see that? Then select the “type” of number in the lower left corner (circled above).
November 15, 2017 at 3:57 am #99630
Found out I had the old version, oops.. Thanks David! Although it works, I cannot multiply with for example 1.05 etc (to adjust 5%), only with numbers without decimals (I.E 2 or 5).
Is there any reason for this?
November 15, 2017 at 4:10 am #99631
Also. Would it be possible to adjust the script to enter a number formatted as: 6 342,- and keep this same style after adjusting the price?
November 15, 2017 at 8:38 am #99635
Anders: When I try it, I can multiply any number by any number, even with decimals. I am not sure why it is not working for you.
Adjusting a script requires someone who is a scripter, such as the person who originally wrote this. I do not know how difficult that would be. Probably a big job.
November 15, 2017 at 8:47 am #99636
One option would be to convert all your numbers to a style that the script can recognize, then run the script, then convert them back. You could do this with the GREP tab in the Find/Change dialog box. For example, you could search for
(\d)\h(\d\d\d),-and replace it with
That would find 6 342,- and replace it with 6,342.00 (Perhaps that is not what you need, but you get the idea…)
Then later you could search for
(\d+),(\d+?)\.(\d+?)and replace it with
which would find 6,342.00 and change it to 6 342,00
November 15, 2017 at 8:56 am #99637
… I confirm:
It is always indeed very boring when great scripts like the one written by Steve Wareham in 2009 on an original idea of … David Blatner [ ;-) ] proves a little limited!
Personal [private] version [v. 5, not definitive]:
… Just +400 absolutely clever code lines to be explored without moderation! …
November 15, 2017 at 9:19 am #99638
Michel, that looks great! It looks like you built some great features on top of Steve’s free script. Are you making it available for download?
November 15, 2017 at 2:40 pm #99647
Sorry but it was just to show that modify Steve’s script is doable!
I’ve spent too much time on it to share my personal version!
That’s because nobody did it that I’ve needed to do it for my own use and we aren’t talking about a 5-lines script, but +500!
November 15, 2017 at 2:58 pm #99648
I see your point, Michel. I do not know if Steve’s original script was released with any specific licensing, but often freely provided scripts would fall under the GNU General Public License https://en.wikipedia.org/wiki/GNU_General_Public_License
which says that if you build software on top of the open source software, then you cannot charge for any distribution of that software — it must also be made freely available. You can charge for support, or documentation, or other things, but not the software itself.
November 15, 2017 at 3:19 pm #99649
A lot wouldn’t appreciate I can make money on such a script, whose original version is free!
Totally hypocritical!! Anyway, a lot see me as a “Sith” since I decided not to give henceforth scripts for free!
Obi-wan Kenobi, Jedi forever!
November 20, 2017 at 3:15 pm #99795
I think that this script allows you to do what you want: http://www.kahrel.plus.com/indesign/price_adjuster.html
The script is a combination of Steve Wareham’s number adjuster and Olav Kvern’s price updating scripts with some embellishments. It handles more thousand seperator symbols than just comma and dot,so it may work for you.
November 22, 2017 at 1:57 am #99812
Thanks Peter! This works perfectly :D
You must be logged in to reply to this topic.