Copy link to clipboard
Copied
Hi everyone,
I was trying to adapt a script that a user of this community kindly compiled for me, and I am getting the error 29446, and I don't know why.
I will post a screenshot of the error and the code, so maybe someone can explain what is wrong.
var folder = Folder.selectDialog("Select the folder");
var myDialog = app.dialogs.add({
name: "Custom Dialog",
canCancel: true
});
with(myDialog.dialogColumns.add()) {
with(dialogRows.add()) {
staticTexts.add({staticLabel: "Height (mm):"});
var heightField = textEditboxes.add({editContents: "000"});
}
with(dialogRows.add()) {
staticTexts.add({staticLabel: "Width (mm):"});
var widthField = textEditboxes.add({editContents: "000"});
}
}
if (myDialog.show() == true) {
var height = heightField.editContents;
var width = widthField.editContents;
myDialog.destroy();
} else {
alert("Task closed.");
}
var heightMillimeters = height + "mm";
var widthMillimeters = width + "mm";
if (folder != null) {
var files = folder.getFiles();
for (var i = 0; i < files.length; i++) {
var document = app.open(files[i]);
document.documentPreferences.pageHeight = heightMillimeters;
document.documentPreferences.pageWidth = widthMillimeters;
document.save();
document.close();
}
}
Copy link to clipboard
Copied
Hi @Carmelo5FA3
Please change this line:
var files = folder.getFiles("*.indd");
Copy link to clipboard
Copied
Hi @Anantha Prabu G, and thanks (again) for your help.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more