Automatically update prices in a indesign document

Home Forums InDesign Add-ons (Scripts, Scripting, and Plug-ins) Automatically update prices in a indesign document

Tagged: ,

This topic contains 14 replies, has 3 voices, and was last updated by  Obi-wan Kenobi 2 days, 6 hours ago.

  • Author
    Posts
  • #99568

    Hi

    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).

  • #99570

    Hi,

    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!

    (^/)

  • #99571

    David Blatner
    Keymaster

    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?

  • #99572

    “When you say it does not work, what happens?” …

    I suppose: “Nothing!” =D

    (^/)

  • #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

  • #99602

    David Blatner
    Keymaster

    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).

  • #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?

  • #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?

  • #99635

    David Blatner
    Keymaster

    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.

  • #99636

    David Blatner
    Keymaster

    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 $1,$2.00

    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 $1 $2,$3
    which would find 6,342.00 and change it to 6 342,00

  • #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]:

    https://imgur.com/a/iSHY6

    … Just +400 absolutely clever code lines to be explored without moderation! …

    (^/)

    • #99638

      David Blatner
      Keymaster

      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?

  • #99647

    David,

    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!

    (^/)

  • #99648

    David Blatner
    Keymaster

    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.

  • #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!

You must be logged in to reply to this topic.