Copy link to clipboard
Copied
Hi guys,
i'm tryng to find a way to automatically change the prices in my pricelist.
I have to add 5% to the original price, is there a script to automatically do that?
At now all i have found wasn't compatible with my id version, 16.4, or not working/error.
Thanks
#indesign #price #script
Copy link to clipboard
Copied
Are you using Styles?
Copy link to clipboard
Copied
Paragraph style at the moment, but add a carachter style isn't a problem.
Copy link to clipboard
Copied
Right - so you you're using a Paragraph Style
Partial solution below - perhaps
Here's what I'd do - and it's dirty but should work.
Create a new TOC with the use of the Paragraph Style for your pricing.
You don't need to add page numbers or anything - so you should get a straight shot of all your pricing in a list, like a TOC.
Copy and paste that to Excel
Add your price increase %
That's as far as I got... I can't think of a way to transpose it back to InDesign...
Copy link to clipboard
Copied
I did it before, but the prices are rounded up without a rule.
The customer decide price by price...
So if i apply the +5% and decide that under 0.5 the round up must be to 0, and so on, i can go wrong...
Thanks a lot.
Copy link to clipboard
Copied
You need to apply a rounding rule to Excel
Copy link to clipboard
Copied
Sure, but they have already rouded up the price.
And the prices are in tables with non sequential lines.
So the best would be have a script, i think.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thanks,
but i'm not using linked excel file.
This is why i'm tryng to find a script solution.
Copy link to clipboard
Copied
This script seems a goodfit for your needs, did you try it?
https://creativepro.com/free-script-to-change-all-numbers-in-a-document-using-math/
-Manan
Copy link to clipboard
Copied
Yes i've used it.
It works, but doesn't works with decimals.
I have to increse by 5%, when i multiply for 1.05, th escript doesn't change nothing.
Also the script "price_adjuster" doesn't work.
Copy link to clipboard
Copied
There's this but it's rather expensive: http://emsoftware.com/products/emcatalog/
Copy link to clipboard
Copied
> It works, but doesn't works with decimals.
It does. There's a drop-down for it
> I have to increse by 5%, when i multiply for 1.05, th escript doesn't change nothing.
Works fine when I try it.
Give this one a shot:
https://creativepro.com/files/kahrel/indesign/price_adjuster.html
Copy link to clipboard
Copied
id version, 16.4, the script doesnt works.
"Number adjust" script works, but not with decimals.
I dont know why guys....
Copy link to clipboard
Copied
I tried it with the same version as yours. It seems to be working fine.
I understand a little.
Do you mean that your data has a decimal price this time and you want to keep the original decimal digits?
And isn't the number of digits constant?
If not, will this setting not work?
What will happen?
Copy link to clipboard
Copied
I don't know why, but it doesn't works for my.
I tried everything....
This is an example of my data. Only if i multiply for 1.05 i have problems. The other maths works.
I also tried in a new document, without tables, nothing...
Thanks but i don't know why.
It could be very useful for me.
Copy link to clipboard
Copied
Does this result match your test?
Are you dissatisfied with not keeping the number of digits?
I'll look into the script for the cause.
Copy link to clipboard
Copied
I modified the function a little.
Does this result look good?
Copy link to clipboard
Copied
Yes looks good.
Another topic should be the round up, but let's go step by step 😄
Copy link to clipboard
Copied
I have applied your modify to my script, i still have the same result... 😞
Copy link to clipboard
Copied
I imagine you added a new line on line 56.
" return Number (myNumber) .toFixed .... "
I also imagine that lines 49-55 are enclosed in " /* " ~~ " */ " and not commented out.
Copy link to clipboard
Copied
yes, right
Copy link to clipboard
Copied
Ajabon it seems to work perfectly with you.
This is exactly the result i was looking for.
When i multiply for 1.05, the results is that the script only delete the ,00.
Thanks for going deep in this topic, i think many people will find useful a solution.
Copy link to clipboard
Copied
Just for the record, the script I linked, above, produces the results you say you're after. In a table, outside a table, frame selected, column selected, etc. etc. Maybe you didn't select the correct number format (dots for thousand separators, commas for decimals) or maybe you didn't select the number of decimals. I highlighted them in the screenshot.
P.