Answered
Script qr code
Can somebody help me with a script that find url codes and change it to a QR code with a object style named test.
kind regards,
Patrick
Can somebody help me with a script that find url codes and change it to a QR code with a object style named test.
kind regards,
Patrick
Try this snippet :
//////////////////////////////////////////////////////////////////////////////////////////////////////
app.findGrepPreferences = NothingEnum.nothing;
app.changeGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences.findWhat = "((([A-Za-z]{3,9}:(?:\\/\\/)?)(?:[-;:&=\\+\\$,\\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\\+\\$,\\w]+@)[A-Za-z0-9.-]+)((?:\\/[\\+ \\/.\\w_]*)?\\??(?:[-\\+=&;%@.\\w_]*)#?(?:[\\w]*))?)";
var allFound = app.documents[0].findGrep();
for(var i = 0; i < allFound.length ; i){
var urlLink = allFound[i].texts[0].contents.toString();
var qrCodeObject = allFound[i].insertionPoints[-1].rectangles.add({geometricBounds:[0, 0, 10, 10]});
qrCodeObject.createHyperlinkQRCode(urlLink);
qrCodeObject.label = "QR-URL";
allFound[i].texts[0].contents = "";
app.documents[0].recompose();
allFound = app.documents[0].findGrep();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
[Code Edited]
Sunil
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.