Thread View: adobe.scripting.indesign
2 messages
2 total messages
Started by Justin_Monsees
Fri, 06 Mar 2009 04:28
Open File Dialog Box (JS)
Author: Justin_Monsees
Date: Fri, 06 Mar 2009 04:28
Date: Fri, 06 Mar 2009 04:28
9 lines
1014 bytes
1014 bytes
I know that in order to open a file dialog box and get a file I have to use this code:
myFile = File(File.openDialog("Import XML","XML Files: *.xml"))
This is what I use to open XML files. Now I want to be able to open a folder based on the label of the textFrame. I can get the label and build the file path. How can I open a dialog box that already points to a specific folder? Also, how can I check with the script if there are files within the folder?
Thanks,
Justin M.
Re: Open File Dialog Box (JS)
Author: Kasyan_Servetsky
Date: Fri, 06 Mar 2009 07:37
Date: Fri, 06 Mar 2009 07:37
27 lines
1112 bytes
1112 bytes
How can I open a dialog box that already points to a specific folder?
var myFolder=Folder("/C/XYZ");
var myMask="INDD:*.indd";
var myFile=myFolder.openDlg("Select Files To Open", myMask, true);
Also, how can I check with the script if there are files within the folder?
var myFolder = Folder.selectDialog("Please select path to files");
if (myFolder!=null) {
var fileList = myFolder.getFiles();
alert("The selected folder contains " + fileList.length + " files.");
}
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads