Question
Open Dialog doesn't open files
I am using the following to browse for multiple files to open.
var myFileMain = File.openDialog ("Select a file", "Documents:*.indd",false);
However, when I add this line to display the files I get the error "undefined, not an object"
var myLayoutWindow = myDocument.windows.add();
I have even just copied the snippet from the Official Scripting Guide to see if I was causing the error with my first line but I get the same error here for the second line.
var myDocument = app.open(File("/c/myTestDocument.indd"), false);
var myLayoutWindow = myDocument.windows.add();
So I tried switching the first line to true instead of false but then in testing in Indesign I get the message that no documents are open.
Can anyone point out what I am doing wrong?
var myFileMain = File.openDialog ("Select a file", "Documents:*.indd",false);
However, when I add this line to display the files I get the error "undefined, not an object"
var myLayoutWindow = myDocument.windows.add();
I have even just copied the snippet from the Official Scripting Guide to see if I was causing the error with my first line but I get the same error here for the second line.
var myDocument = app.open(File("/c/myTestDocument.indd"), false);
var myLayoutWindow = myDocument.windows.add();
So I tried switching the first line to true instead of false but then in testing in Indesign I get the message that no documents are open.
Can anyone point out what I am doing wrong?