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

How to find and edit QR Codes using scripting

Explorer ,
Jan 16, 2025 Jan 16, 2025

Copy link to clipboard

Copied

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? 

TOPICS
Scripting

Views

896

Translate

Translate

Report

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 ,
Jan 16, 2025 Jan 16, 2025

Copy link to clipboard

Copied

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

 

Votes

Translate

Translate

Report

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
Explorer ,
Jan 16, 2025 Jan 16, 2025

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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 ,
Jan 16, 2025 Jan 16, 2025

Copy link to clipboard

Copied

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

 

Votes

Translate

Translate

Report

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 ,
Jan 16, 2025 Jan 16, 2025

Copy link to clipboard

Copied

THERE IS 😄

 

But you can't re-create  EDIT it - you would need to destroy current QRCode and create a new one.

 

Votes

Translate

Translate

Report

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
Explorer ,
Jan 16, 2025 Jan 16, 2025

Copy link to clipboard

Copied

That's fine! We just need a way to read them in and check them, in order to make sure they are formatted correctly, and also needed modifications are added (Such as UTM codes). That's up to the Designers to fix, but we need a way to check them. We litterely have 1000's of documents coming in each month. Paying someone to check them manually would be too time consuming and not very cost effective.

Votes

Translate

Translate

Report

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
Explorer ,
Jan 16, 2025 Jan 16, 2025

Copy link to clipboard

Copied

Having said that.... not being able to edit the URL seems a bit silly. What is the point of Adobe FORCING people to do things manually?? I thought that was the whole point of scripting???

Votes

Translate

Translate

Report

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 ,
Jan 16, 2025 Jan 16, 2025

Copy link to clipboard

Copied

quote

Having said that.... not being able to edit the URL seems a bit silly. What is the point of Adobe FORCING people to do things manually?? I thought that was the whole point of scripting???


By @Ken Webster

 

There are a lot of things that are half baked ... like MathML ...

 

Votes

Translate

Translate

Report

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 ,
Jan 16, 2025 Jan 16, 2025

Copy link to clipboard

Copied

RobertatIDTasker_0-1737062804724.png

 

Votes

Translate

Translate

Report

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 ,
Jan 17, 2025 Jan 17, 2025

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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 ,
Jan 17, 2025 Jan 17, 2025

Copy link to clipboard

Copied

Make them as external files and link? Instead of generating in the InDesign? Of course InDesign can be used to generate them. 

 

Which would be the only sensible solution - till Adobe adds option to re-generate them through scripting. 

 

Votes

Translate

Translate

Report

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
Explorer ,
Jan 22, 2025 Jan 22, 2025

Copy link to clipboard

Copied

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!!

Votes

Translate

Translate

Report

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 ,
Jan 22, 2025 Jan 22, 2025

Copy link to clipboard

Copied

Even your workaround sounds quite interesting but I don't understand how it works. Could you please add a link to Sunil's post?

Votes

Translate

Translate

Report

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 ,
Jan 22, 2025 Jan 22, 2025

Copy link to clipboard

Copied

quote

Even your workaround sounds quite interesting but I don't understand how it works. Could you please add a link to Sunil's post?


By @m1b

 

Snippet. 

 

Votes

Translate

Translate

Report

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 ,
Jan 22, 2025 Jan 22, 2025

Copy link to clipboard

Copied

@Ken Webster 

 

It's possible to export Rectangle with QR code to a Snippet - and read the value:

 

<PlainTextQRCode Self="uf7" PlainText="ALPHA">

 

And it's possible to change it in the exported Snippet file - and then refresh.

 

RobertatIDTasker_1-1737585006270.png

 

Top left - original QR code and snippet.

Top right - placed edited Snipped and its contents - preview is wrong but it "knows" the new text value.

 

Bottom left - still original QR code.

Bottom right - refreshed QR code - via script.

 

Votes

Translate

Translate

Report

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 ,
Jan 22, 2025 Jan 22, 2025

Copy link to clipboard

Copied

Got it. Unfortunately that means it only works if the QR Code was generated by Indesign. Still it would be sensible to be able to access that value via the scripting APIs, especially since the value exists, as the snippet shows. I've created a feature request for this

 

@Ken Webster I doubt that Adobe sees many of these posts, so please vote on the feature request and leave a comment there if you have better ideas than my quick one.

- Mark

Votes

Translate

Translate

Report

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 ,
Jan 22, 2025 Jan 22, 2025

Copy link to clipboard

Copied

So, @m1b and @Robert at ID-Tasker, meta-question on this thread since I can't quite parse it out from the discussion —

  • Does ID retain the encoded data in some form, for later editing, or does the QR code applet simply read back the code as it's encountered?

 

I'm ass/u/ming the former, since most QR functions work only with an ID-generated code — if 'read back,' it would/should work with any valid code from any source, as long as the graphic is recognized as a QR code.


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.1 ┊ (Amazon) ┊┋

Votes

Translate

Translate

Report

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 ,
Jan 22, 2025 Jan 22, 2025

Copy link to clipboard

Copied

@James Gifford—NitroPress

 

Raw "contents" of the code that you enter in the InDesign's UI is preserved internally.

 

If you drag&drop frame with QR code to your drive - you'll get a Snippet - where you can find what you've entered in InDesign. 

 

After you edit Snippet - you can place Snippet back - it will show old preview of the QR code - if you try to edit QR code - it will show you new values you've entered manually in the Snippet file. 

 

If you confirm - InDesign will refresh preview of the QR code. 

 

Votes

Translate

Translate

Report

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 ,
Jan 22, 2025 Jan 22, 2025

Copy link to clipboard

Copied

quote

 

  • Does ID retain the encoded data in some form, for later editing, or does the QR code applet simply read back the code as it's encountered?

By @James Gifford—NitroPress

 

You can select existing QR code and select "Edit QR code".

 

Votes

Translate

Translate

Report

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 ,
Jan 22, 2025 Jan 22, 2025

Copy link to clipboard

Copied

You can select existing QR code and select "Edit QR code".

 

Yes, of course, that's my whole point. But whence comes the re-editing data? You say it's stored separately (for ID-generated codes, at least); that's the info I was looking for.

 


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.1 ┊ (Amazon) ┊┋

Votes

Translate

Translate

Report

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 ,
Jan 22, 2025 Jan 22, 2025

Copy link to clipboard

Copied

quote

You can select existing QR code and select "Edit QR code".

 

Yes, of course, that's my whole point. But whence comes the re-editing data? You say it's stored separately (for ID-generated codes, at least); that's the info I was looking for.


By @James Gifford—NitroPress

 

Depends on what do you mean by "stored separately". 

 

If you check contents of the Snippet file - there is a link to the file in the temp folder on your drive. 

 

But QR codes aren't linked to files - they are embedded. 

 

Votes

Translate

Translate

Report

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 ,
Jan 22, 2025 Jan 22, 2025

Copy link to clipboard

Copied

I know (most of) this. In the end, a QR code is just another stored graphic in the INDD file. One created and placed from outside is not and can't be anything else.

 

BUT... as we can edit codes created within ID, even those with a rather complex data string, the question is whether ID stores that (text or equivalent) data somewhere, as a separate, theoretically editable element, independently of the little dotty graphic. Or... does it simply "read" the code to produce the re-editing data/string?


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.1 ┊ (Amazon) ┊┋

Votes

Translate

Translate

Report

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 ,
Jan 22, 2025 Jan 22, 2025

Copy link to clipboard

Copied

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

 

Votes

Translate

Translate

Report

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 ,
Jan 22, 2025 Jan 22, 2025

Copy link to clipboard

Copied

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

?


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.1 ┊ (Amazon) ┊┋

Votes

Translate

Translate

Report

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 ,
Jan 22, 2025 Jan 22, 2025

Copy link to clipboard

Copied

@James Gifford—NitroPress

 

I'm replying from my phone - but in the Snippet file - there was a section with generated preview - most likely vector - and section with raw text - as per my earlier screenshot.

 

I even removed this preview data - and after placing Snippet - Rectangle was grayed out - but it refreshed after using edit option. 

 

It looks like it's the same way as with Equations in EPS exported from WORD - graphical representation + raw data for editing. 

 

Or PDF - preview for use + all data for editing. 

 

Votes

Translate

Translate

Report

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