Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Verify prices with javascript

Engaged ,
Feb 15, 2023 Feb 15, 2023

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

TOPICS
Scripting
532
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 15, 2023 Feb 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"); } 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 15, 2023 Feb 15, 2023
LATEST

Hi Brian


that sounds like a way I can start. 🙂 Thanks

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines