I am building a custom app, where I have to perform basic mathematical calculations on an indesign template(like incrementing value in a text area when a button is clicked). This is similar to adding/removing the product and displaying the quantity in a field.

I was looking for a script that did a calculation on numbers in my doc (in this case, subtracting 1 from a bunch of numbers in various formats - x, y, z or x ^t y ^t z ^t i.e. in a table) & I just found this fab script & I wish I had found that ages ago - is going to save me an immense amount of time!! It may be able to help you.

Thank you for the suggestion. I did write a javascript to perform the action using HTML and Js and embedded that into the template(via Object>Insert HTML option). The main problem is I need to access other elements/frame when I perform the action. Its similar to adding an item into a cart on any shopping website(I am clicking on "buy now" that in turn will add the item to cart and display some sort of icon which indicates that there are items in the cart). I tried looking for some resources which could explain the basics of how to write scripts and make them work on the template but no luck.

Need help !!!!

PS: I am very new to Indesign, and have a very limited knowledge on scripting in the Indesign tool.