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?
Copy link to clipboard
Copied
Can't check right now - but i think QR codes are stored as Embedded EPS files.
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.
Copy link to clipboard
Copied
I don't think there is a way to read it back - from a script?
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.
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.
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???
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???
By @Ken Webster
There are a lot of things that are half baked ... like MathML ...
Copy link to clipboard
Copied
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
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.
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!!
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?
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?
By @m1b
Snippet.
Copy link to clipboard
Copied
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.
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.
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
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 —
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
- 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".
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.
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.
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.
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?
Copy link to clipboard
Copied
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.
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 —
?
Copy link to clipboard
Copied
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.