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

How to generate QR by script?

Explorer ,
May 22, 2019 May 22, 2019

Hello,

I have  idea to generate QR codes from http links, by script.

Links will be wriiten as a text lines in a txt or doc file.

Help me please how to start coding the script. Where in API should i look for the methods and properties ? In which suite the QRcode engines egsist?

The QRcode itself is EPS, placed ino a frame, how to first generate the QR by javascript ?

My favorite documentation I always use is here:

https://www.indesignjs.de/extendscriptAPI/indesign14/#Application.html

Thank you for any suggestions

Marcin

TOPICS
Scripting
7.3K
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

correct answers 1 Correct answer

Guide , May 22, 2019 May 22, 2019

No need for external libraries.

You'd create or reuse an EPS page item, then invoke its create ... QRCode () method matching your type, e.g.

https://www.indesignjs.de/extendscriptAPI/indesign14/#EPS.html#d1e240502__d1e242534

The document has the same set of create methods, the QR code is then loaded into the place gun for manual place.

That's as far I remember it from some AppleScript experiments.

Translate
Guide ,
May 22, 2019 May 22, 2019

No need for external libraries.

You'd create or reuse an EPS page item, then invoke its create ... QRCode () method matching your type, e.g.

https://www.indesignjs.de/extendscriptAPI/indesign14/#EPS.html#d1e240502__d1e242534

The document has the same set of create methods, the QR code is then loaded into the place gun for manual place.

That's as far I remember it from some AppleScript experiments.

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 ,
May 22, 2019 May 22, 2019

No time to try, but as it is a method of all page items, would you not just invoke it on an empty rectangle?

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 ,
May 23, 2019 May 23, 2019
LATEST

https://forums.adobe.com/people/%5BJongware%5D  wrote

No time to try, but as it is a method of all page items, would you not just invoke it on an empty rectangle?

And now I've tried it. It is indeed very easy: if you have a handle to an existing rectangle, you can immediately call its own createHyperlinkQRCode method, and the only argument it needs is the URL itself. (Unless you want to change the color etc., but see grefel's documentation for that.)

A one-line test shows this creates the exact same QR code as when done through the interface. In the image below, the left is a QR code generated with the menu option "Generate QR Code", type Web Link, and the right a blank rectangle that, when selected, gets filled with the same URL using the magic line

app.selection[0].createHyperlinkQRCode ("https://www.indesignjs.de/extendscriptAPI/indesign14/#EPS.html#d1e240502__d1e242534");

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
Explorer ,
May 22, 2019 May 22, 2019

Thank you very much 🙂 It's exactly what I need !

As allways the proper place to search is the point!

best regards marcin

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