Skip to main content
Inspiring
February 15, 2023
Question

Verify prices with javascript

  • February 15, 2023
  • 1 reply
  • 561 views

Hi.

It's just an idea, but is it possible to compare and verify whether two or more prices are correct (same)? There are many objects (items) on many pages, so I need a quick way to check the correctness of the prices. I wanted to do it with a script (javascript).
Can I combine two text frames (not a chain or anchored object!) to get a reference to each other?
Please take a look at the attached graphic. My minimum aim is to check prices with the same color. This is just a dummy! The original has no colored prices. 🙂 But character- and paragraph-styles.

Never mind, if you mean it is a stupid idea. Not that important. 😉

This topic has been closed for replies.

1 reply

brian_p_dts
Community Expert
Community Expert
February 15, 2023

Sure it's possible, but not trivial. You could apply a script label to the cell with the price, and have the check price in a named nonvisible text frame on the page, then loop through the pages and say something like:

if (labeledCell.contents !== priceFrame.contents) { alert("Prices don't match"); } 

cmoke73Author
Inspiring
February 16, 2023

Hi Brian


that sounds like a way I can start. 🙂 Thanks