Skip to main content
Known Participant
January 16, 2025
Question

How to find and edit QR Codes using scripting

  • January 16, 2025
  • 4 replies
  • 4106 views

There appears to be several methods available in order to create QR Codes within the Scripting API. What we need is a way to find each QR Code and examine/edit the URL. There apprears to be nothing listed for this within the API documentation. Is there any way to step through the Graphics in each doucment, determine whether or not they are QR Codes, and if they are, to then check/edit the URL? 

4 replies

M S V
Inspiring
January 31, 2025

hi 

looking in the properties of the links in an Indesign document

I've seen then QRCodes generated in Indesign have

the name starting with "QR Codexxxxx" and the status link embedded

so you can make an array of all links and test name and status to find every QR Code

Robert at ID-Tasker
Legend
January 31, 2025
m1b
Community Expert
Community Expert
January 17, 2025

Hi @Ken Webster, do you create all the QR Codes in-house? Or are they existing QR Codes that come from other sources? It's a strange question, but I'm asking because I can think of possible solutions to this but it only works going forward with newly-created QR Codes that you've made in-house. This is probably a deal-breaker, but you can let me know.

- Mark

Known Participant
January 22, 2025

Long story short - We (I) found a somewhat painful solution. I took the code that Sunil Yadav posted in another thread and modified it. He basically takes the PageItem object holding the QR Code, writes it to file as XML, reads the file back in and looks for the QRCode tag. It's not very elegant and it's clunky, but it works... for the most part. There's an old saying about "Walking all the way around the block just to go next door" Well, this is like hoping on a flight to Europe to buy a soda.
Dear Adobe... QR Codes have been around for over 30 years. YOU NEED TO DO BETTER!!

James Gifford—NitroPress
Legend
January 23, 2025

@James Gifford—NitroPress

 

What do you mean by "somewhere"?

 

Text you enter in the UI - in the dialog when you create / edit QR code - is stored together with the displayed code. 

 


That's my question. Is the data stored in a form outside the generated graphic, and if so, where, and is it independently accessible in any way (and, while we're here, does changing it make ID change the generated graphic, or is it just a recorded point from which ID can create a new graphic with any changes to that string?)

 

Put another way, is an ID-generated QR code, in an INDD file —

  • One element, the generated graphic (this seems to be a definite 'no), or
  • Two separately-maintained elements, the generated graphic and some form of the text data string (which can be called back up by the code editor), or
  • Two linked elements in that ID would respond to changes in the stored string and re-generate the graphic element without an explicit open/edit/re-generate action at the UI level

?

Robert at ID-Tasker
Legend
January 16, 2025

 

Robert at ID-Tasker
Legend
January 16, 2025

Can't check right now - but i think QR codes are stored as Embedded EPS files. 

 

Known Participant
January 16, 2025

Yes they are.. But we still need a way to determine if the embedded EPS file is a QR Code, and then read the URL string.

Robert at ID-Tasker
Legend
January 16, 2025

I don't think there is a way to read it back - from a script?