We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.
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.
#indesign #price #script
Are you using Styles?
Paragraph style at the moment, but add a carachter style isn't a problem.
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...
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.
You need to apply a rounding rule to Excel
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.
but i'm not using linked excel file.
This is why i'm tryng to find a script solution.
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.
> 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:
id version, 16.4, the script doesnt works.
"Number adjust" script works, but not with decimals.
I dont know why guys....
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?
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.
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.
I modified the function a little.
Does this result look good?
Yes looks good.
Another topic should be the round up, but let's go step by step 😄
I have applied your modify to my script, i still have the same result... 😞
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.
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.
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.