Copy link to clipboard
Copied
Hello,
I am taking my first steps in scripting in InDesign and I am faced with a simple issue. I am trying to execute this script from the Scripts Panel in InDesign CC 2021:
var easyCatalogFilePath = "testFile.txt"
Very interesting! I didn't know that EasyCatalog is scriptable. Do they have some sample scripts? Found them here. I don't have it installed but your very first line makes me embarrassed. From the variable name, I assume, it should be a full path to the file, not the file name. Something like this:
var easyCatalogFilePath = "/C/folder/subFolder/subSubFolder/testFile.txt";
Make sure to check if the file exists and if so go on with your code.
if (File(easyCatalogFilePath).exists) {
// do so...
Copy link to clipboard
Copied
Hi @Bill3862 var myEasyCatalog = app.easycatalogObject; would also throw an error because there‘s no easycatalogObject Application object.
Here’s the InDesign ExtendScript API:
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Application.html
Copy link to clipboard
Copied
Rob, I believe Easy Catalog can be scripted: https://www.65bit.com/software/easycatalog/modules/scripting-module/
Copy link to clipboard
Copied
Don't know much about Easy Catalog scripting but I would start by ensuring you have the full path to your txt file. Ie, "~/Desktop/testFile.txt" would point to your desktop, whereas app.activeScript.fsName + "/testFile.txt" would point to the same directory as wherever you are executing the script from.
Copy link to clipboard
Copied
Very interesting! I didn't know that EasyCatalog is scriptable. Do they have some sample scripts? Found them here. I don't have it installed but your very first line makes me embarrassed. From the variable name, I assume, it should be a full path to the file, not the file name. Something like this:
var easyCatalogFilePath = "/C/folder/subFolder/subSubFolder/testFile.txt";
Make sure to check if the file exists and if so go on with your code.
if (File(easyCatalogFilePath).exists) {
// do something
}
Copy link to clipboard
Copied
I think it's time to call it a day when you forget to paste the whole path and pay no mind to it! Thank you for pointing that out Kasyan.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more