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?
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/
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 )
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/
Copy link to clipboard
Copied
Thanks Colin.
I selected my element but fillColor doesnt work for qrcodes!
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. 🙂
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 )
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..
Copy link to clipboard
Copied
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!