Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


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

88

Likes

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

Adobe Community Professional , 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/

Likes

Translate

Translate
Adobe Community Professional , 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 )

Likes

Translate

Translate
Adobe Community Professional ,
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/

 

Likes

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!

Likes

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
Engaged ,
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: A Professional Guide. (It's on Amazon.) |||

Likes

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
Adobe Community Professional ,
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 )

 

Likes

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

Likes

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! 

 

Likes

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