
Kasyan Servetsky
Valorous Hero
Kasyan Servetsky
Valorous Hero
Activity
‎May 27, 2025
04:39 AM
Hi Uwe, Thanks for pointing this out. Although I have never used this method in my life, it sounds like intended behavior to me: change this and all other instances of the link. It makes sense to me. — Kasyan
... View more
‎May 15, 2025
12:55 AM
3 Upvotes
On my side, while running your original version, both on Mac (2024, 2025) & Windows (2024), I get the following error: The problem is you can't modify a doc while the modal dialog is open. Here's my version: #target indesign
makeDialog();
function makeDialog() {
var dlg = new Window("dialog", "Generate QR CSV for SmartStream");
dlg.orientation = "column";
dlg.alignChildren = "left";
dlg.add("statictext", undefined, "From:");
var fromInput = dlg.add("edittext", undefined, "1");
fromInput.characters = 10;
dlg.add("statictext", undefined, "To:");
var toInput = dlg.add("edittext", undefined, "1000");
toInput.characters = 10;
dlg.add("statictext", undefined, "Leading Zeros:");
var zeroInput = dlg.add("edittext", undefined, "4");
zeroInput.characters = 10;
dlg.add("statictext", undefined, "Prefix (e.g., https://www.xymo.co/p/078873-05|050725|):");
var prefixInput = dlg.add("edittext", undefined, "");
prefixInput.characters = 40;
dlg.add("statictext", undefined, "Prefix Font Size (pt):");
var fontSizeDropdown = dlg.add("dropdownlist", undefined, [
"4", "5", "6", "7", "8", "9", "10", "11", "12", "13"
]);
fontSizeDropdown.selection = 6; // Default: 10pt
dlg.add("statictext", undefined, "CSV File Name (no extension):");
var fileNameInput = dlg.add("edittext", undefined, "qr_codes");
fileNameInput.characters = 30;
var generateBtn = dlg.add("button", undefined, "Create .CSV", { name: "ok" });
generateBtn.onClick = function () {
// the vars in this handler are global to make them available in the main function
from = parseInt(fromInput.text, 10);
to = parseInt(toInput.text, 10);
zeroPad = parseInt(zeroInput.text, 10);
rawPrefix = String(prefixInput.text);
prefix = rawPrefix; // for CSV
cleanedPrefix = rawPrefix.replace(/^https:\/\/www\.xymo\.co\/p\//, ""); // for document
fontSize = parseInt(fontSizeDropdown.selection.text, 10);
fileName = String(fileNameInput.text).replace(/^\s+|\s+$/g, '');
dlg.close(1);
};
dlg.center();
var showDialog = dlg.show();
if (showDialog == 1) {
main();
}
}
function main() {
try {
if (
isNaN(from) || isNaN(to) || isNaN(zeroPad) || isNaN(fontSize) ||
from > to || fileName === ""
) {
alert("Invalid input. Please verify all fields.");
return;
}
// Build CSV
var csvLines = [];
csvLines.push("QTY,QR Text Line,|,#QRcodes");
var qty = 1;
for (var i = from; i <= to; i++) {
var num = i.toString();
while (num.length < zeroPad) num = "0" + num;
var fullCode = prefix + num;
csvLines.push(qty + "," + fullCode + ",|," + fullCode + "|");
qty++;
}
// File setup
var safeName = fileName.toLowerCase();
var fullFileName = safeName.indexOf(".csv") === safeName.length - 4 ? fileName : fileName + ".csv";
var desktopFolder = Folder.desktop;
var filePath = desktopFolder.fsName + "/" + fullFileName;
var file = new File(filePath);
// Save CSV
if (file.open("w")) {
file.encoding = "UTF-8";
file.write(csvLines.join("\n"));
file.close();
} else {
alert("Failed to write file:\n" + file.fsName);
return;
}
// Add cleaned prefix to document
var doc = app.activeDocument;
var page = doc.pages[0];
var marginPrefs = doc.marginPreferences;
var bounds = page.bounds;
var top = bounds[0] + marginPrefs.top;
var left = bounds[1] + marginPrefs.left;
var prefixFrame = page.textFrames.add();
prefixFrame.geometricBounds = [top, left, top + 30, left + 300];
prefixFrame.contents = cleanedPrefix;
var text = prefixFrame.parentStory.texts[0];
text.appliedFont = "Arial";
text.fontStyle = "Regular";
text.pointSize = fontSize;
// Try to open CSV with SmartStream
try {
file.execute();
} catch (e) {
alert("CSV saved, but could not auto-open in SmartStream.\nFile path:\n" + file.fsName);
dlg.close();
return;
}
alert("CSV created, SmartStream launched, and cleaned prefix added to document.");
} catch (e) {
alert("Script error: " + e.message + " - line " + e.line);
}
}
... View more
‎May 01, 2025
09:39 AM
1 Upvote
It is possible to do by a script. Here is a simple example where a part/product number corresponds to a price.
... View more
‎Apr 27, 2025
11:45 PM
>> Can you share the script with me? The script is published on my site: the link is in my previous post.
... View more
‎Apr 26, 2025
10:23 AM
1 Upvote
Here's another script for merging docs. I used the following settings and got this result (attached). After running the script, I had to set manually the 1st page numbering to 1. Also, I noticed that in the file 003-Chapter III. Price classification.indd, the rectangles on master pages were blue, but became yellow in the merged doc. I think this happened because the master pages have the same name but different definitions.
... View more
‎Apr 25, 2025
04:03 AM
Make sure to save metadata after entering them: in InDesign — save doc in Bridge — hit the Apply button at bottom-right of the panel In Bridge, you can search files located on DropBox as usual.
... View more
‎Apr 25, 2025
12:41 AM
How about using metadata for this? It's available both in Bridge and InDesign
... View more
‎Apr 23, 2025
03:32 AM
The InDesignSecrets Guide to Special Characters in Adobe InDesign
... View more
‎Apr 22, 2025
03:48 AM
Hi Boris, Here I posted scripts written (especially, according to their requirements) for the L'Express de Toronto newspaper. All repetitive processes — almost everything you can do manually in InDesign — can be automated. — Kas
... View more
‎Mar 24, 2025
01:38 AM
It still works for me as it was back in CS3 times. Make sure to save images in the grayscale mode without a transparent background. Place it in InDesign, select the direct selection tool (white arrow), select the image (the contents — not the frame), and choose a color.
... View more
‎Mar 20, 2025
04:23 AM
@Robert at ID-Tasker, I have no idea about what OP's workflow is/going to be, and how the part numbers were originally inserted into text frames. From the screenshot, I see that each text frame contains a number so my guess it was done manually: copy — paste. In this case, IMO it makes no difference either paste it into a frame or label. Assuming it's a catalog updated on a regular basis, I'd rather make a template with labeled frames — manually but only once — and run the script to fill in/update prices.
... View more
‎Mar 20, 2025
03:56 AM
1 Upvote
This can be done by scripting. Here I wrote a somewhat similar script that is based on my Get data directly from Excel function. (BTW, I recently updated the function for MAC so it works with the POSIX path format). It's possible to do as you want: say, find the part # from column A and replace it with the price from column B. But, in my opinion, a more elegant sulution would be to make a doc/template with labeled text framed whose labels correspond to part numbers.
... View more
‎Mar 13, 2025
01:46 AM
3 Upvotes
I found the script below but it's not working in Indesign 20.2 This script can't work in any version: everything is wrong there. Here I made a working version. Tested in Indy 19.5 and 20.0. var doc = app.activeDocument;
var docPathNoExt = doc.fullName.absoluteURI.replace(/\.[^\.]+$/, "");
// PDF Export
function exportPDF() {
var pdfFile = new File(docPathNoExt + ".pdf");
var pdfPreset = app.pdfExportPresets.item("[PDF/X-4:2008]");
doc.exportFile(ExportFormat.PDF_TYPE, pdfFile, false, pdfPreset);
}
// PNG Export
function exportPNG() {
var pngExportPrefs = app.pngExportPreferences;
with (pngExportPrefs) {
pngQuality = PNGQualityEnum.MAXIMUM;
transparentBackground = true;
exportResolution = 72;
pngExportRange = PNGExportRangeEnum.EXPORT_ALL;
pngSuffix = "_page_^P";
}
var pngFile = new File(docPathNoExt + ".png");
doc.exportFile(ExportFormat.PNG_FORMAT, pngFile, false);
}
// Call the functions
exportPDF();
exportPNG(); Change PNG export prefs to whatever you need. In a perfect world, this script would work on all open documents (I generally open 32 at a time), but I think that's pushing it. Any help is appreciated. It's possible with my Batch processor script. You can process all files in one go, running them through all folders and subfolders.
... View more
‎Mar 11, 2025
01:04 AM
Try this script.
... View more
‎Mar 06, 2025
04:49 AM
1 Upvote
Hi s@xorNOJ , Here I made a script for you that makes hyperlinks reading data from Excel. Hope it helps! — Kas
... View more
‎Mar 02, 2025
11:27 PM
2 Upvotes
Check out these scripts: Save with backup Save versions
... View more
‎Feb 07, 2025
09:21 AM
1 Upvote
Hi @c.pfaffenbichler, Yes, it works, I know. But there's a typo in the reference: — Kasyan
... View more
‎Feb 06, 2025
06:00 AM
The Photoshop ExtendScript API has a typo in the close method of the Document object. The saving parameter should be SaveOptions instead of SaveOptionsType.
... View more
‎Jan 27, 2025
11:42 PM
Checkout Outline text on all pages scripts
... View more
‎Jan 23, 2025
12:25 AM
1 Upvote
Here's how to get the clipboard contents.
... View more
‎Jan 07, 2025
09:44 AM
I wrote a script for batch processing.
... View more
‎Jan 07, 2025
12:14 AM
Check out this script.
... View more
‎Jan 05, 2025
12:43 PM
1 Upvote
I don't understand your English quite well, but as far as I can see, you may be interested in this script.
... View more
‎Dec 23, 2024
02:09 AM
2 Upvotes
You discovered a bug in the script (Thank you!), and I fixed it. Here’s a new version. Version 5.0 ‘thought’ it was an IDML file (not saved file yet), so it added the superfluous extension. This version adds it only if it is missing and explicitly writes into the log if the file is converted from IDML/an older version. Does it work for you now properly?
... View more
‎Dec 20, 2024
03:10 AM
1 Upvote
... and the outcome is the same with indd x2 ... I tested it on my notebook — windows 10, InDesign 19.5 (too old for 20) — and it works properly. Try the previous version 4.8. Does the problem occur with it? Do you get an error message in the Batch processor 5.0.txt? If an error occurs, it is created on the desktop even when the logging is off. Try to turn logging on. It lists file names. Do they have doubled extensions? Could you send me a file for testing? Maybe something is wrong with the files. In my experience, it sometimes happens when a 3rd party plug-in is used. Try to export a file to IDML and back to INDD and test the script against it. Do you have ESTK / VS Code installed?
... View more
‎Dec 19, 2024
05:54 AM
Here I updated my script. Now, it's a single script that should be installed in the start-up folder. It should work in non-English versions (locales) of InDesign. I tested it in version 2024/5 on Mac & Windows and it works for me.
... View more
‎Dec 19, 2024
01:51 AM
I ran 'single script' and checked 'Save documents on closing', now the new documents with '.indd' on the filenames (I have already got the same as file extension). And the original files are staying the same (previous versions). Is it a way to save over the orginal files by not adding '.indd'? I will use the Backups checkbox option for keeping the original documents, so changing the filenames will ad another step for me to rename. This shouldn't and doesn't happen on my side. Could you take a screenshot of the settings you used? What is your InDesign version? Which platform: Mac/Windows? Are you working locally or on the network? If the latter, are you able to save it manually? Also, if I want to make the metadata author name to 'Company name', how do I tweak the existing code you wrote above? There are a few product lines' documents and they will have different company names on the 'author' metadata, I will need to alter the 'author' for each product and save them under different jsx files. From your original post, looking at your example, I guessed that you want to get the author from the file name: everything from the beginning to the 1st underscore. Here I prepared a new script with an arguments file (author.txt). See the screenshot to get the idea, and read the script description for details.
... View more
‎Dec 18, 2024
12:06 AM
1 Upvote
This can be done with the Batch resave PageMaker files script. If converted files lack fonts, you can replace them with this script. Your example file only uses Arial, so I had to make a few manual tweaks to fit the text. The image is embedded, so there is no problem with it.
... View more
‎Dec 17, 2024
02:48 AM
1 Upvote
Here's a new version (5.0) of my batch processor script (on DropBox). I had no time to post it on my site yet. It supports UXP scripts and IDML files. Let me know if you're able to download it now.
... View more
‎Dec 17, 2024
01:00 AM
1 Upvote
Hi MishoStoev, The latest version of the script and 'step-by-step' sample files are posted on my site: see the link above. To create a shape (text frame) just choose a font, type 25, and convert it to outlines. Finally, edit the shape: set the text inset, move nodes with the white arrow, etc. It should work with Cyrillic: make sure to save the list of names as plain text (Unicode) e.g. in Notepad/TextEdit. To get the best possible result, you will have to experiment with settings in InDesign, such as font size and leading, and probably fine-tune it manually after running the script. I can't help you with this because I'm busy with my daily work. Hope it helps! — Kasyan
... View more