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

Change qrcodes color script

Community Beginner ,
Oct 29, 2021 Oct 29, 2021

Copy link to clipboard

Copied

Hi, im trying to change qrcodes color with js script.

I have a list of qrcodes know and I tried with: 

app.menuActions.item("Edit QR Code...").invoke();

to edit.. so after this step i need to swith to Color tab and after that select name of color..

any suggest? or is there a better way maybe?

TOPICS
How to

Views

574

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

correct answers 2 Correct answers

Community Expert , Oct 31, 2021 Oct 31, 2021

The DOM for that portion of code is here:

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

However, if you're doing this via data merge, I wrote an article that makes colorising QR codes much easier: https://creativepro.com/creating-colored-qr-codes-during-a-data-merge/

 

Votes

Translate

Translate
Community Expert , Nov 04, 2021 Nov 04, 2021

Hi Mesmaili,

did you see into the DOM description?

Property qrCodeSwatch is the one you are looking for.

It will work when you create a new QR code.

 

It will not work after you added a QR code. At least I assume that's your issue.

If you do not want to recreate QR codes see into the other method Colin provided.

The one with the transparency mask. Also scriptable of course.

 

Regards,
Uwe Laubender

( ACP )

 

Votes

Translate

Translate
Community Expert ,
Oct 31, 2021 Oct 31, 2021

Copy link to clipboard

Copied

The DOM for that portion of code is here:

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

However, if you're doing this via data merge, I wrote an article that makes colorising QR codes much easier: https://creativepro.com/creating-colored-qr-codes-during-a-data-merge/

 

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!

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 Beginner ,
Nov 04, 2021 Nov 04, 2021

Copy link to clipboard

Copied

Thanks Colin.
I selected my element but fillColor doesnt work for qrcodes!

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 ,
Oct 31, 2021 Oct 31, 2021

Copy link to clipboard

Copied

Bypass ID altogether, or use it as a generation/export tool, and recolor the QRcode image in Photoshop. Re-import.

 

I suggest this only because your need doesn't seem to be efficient on-the-fly generation, as some uses require — at least, I can't quite visualize the intersection of such efficient production/update and a need to tweak the colors so precisely. 🙂


â•Ÿ Word & InDesign to Kindle & EPUB: a Guide to Pro Results (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 ,
Nov 04, 2021 Nov 04, 2021

Copy link to clipboard

Copied

Hi Mesmaili,

did you see into the DOM description?

Property qrCodeSwatch is the one you are looking for.

It will work when you create a new QR code.

 

It will not work after you added a QR code. At least I assume that's your issue.

If you do not want to recreate QR codes see into the other method Colin provided.

The one with the transparency mask. Also scriptable of course.

 

Regards,
Uwe Laubender

( ACP )

 

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 Beginner ,
Nov 04, 2021 Nov 04, 2021

Copy link to clipboard

Copied

Hi Laubender,

thanks for your answer.

you are right, im trying to change qrcode color after generating.

actually I create qrcodes with dataMerge and need to be another color..

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 Beginner ,
Nov 04, 2021 Nov 04, 2021

Copy link to clipboard

Copied

LATEST

thanks @Colin Flashman @Laubender Thanks guys.

I forgot that I cant change qrcolor after generation.

so I just remove qrcode from datamerge and put it into script and it worked realy nice! 

 

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