Skip to main content
Marcos_Suárez
Known Participant
February 23, 2010
Question

Fix directory of "File.openDialog..."

  • February 23, 2010
  • 1 reply
  • 1424 views

For open a dialog window (for search a file) I do:

myFilePath = File.openDialog("Your file...");

But I need open window, always, in "C:\" directory...

Thanks for read me...

This topic has been closed for replies.

1 reply

Harbs.
Legend
February 23, 2010

Use a reference to a file in the C:\ directory and use:

myFile.openDlg()

Harbs

Roy Marshall
Known Participant
August 11, 2010

Hi.

I am looking to do a similar thing, but pointing to a folder on a named server containing InDesign Files.  Can this initial default folder be set in the same way?

I am currently using "var myFile = File.openDialog("Choose the file Containing the Styles you want to import");" so I am guessing can pass a default directory to the openDialog function?

I have looked and the Object Model doesn't show me this option

Cheers

Roy

Kasyan Servetsky
Legend
August 11, 2010

Try this:

var myFolder = Folder("/C/"); // open C directory
var myFolder = Folder("/Volumes/MountedVolumeName/FolderName/SubFolderName/"); // folder on a server on Mac
var myFolder = Folder("//ServerName/ShareName"); // folder on a server on Windows

var myMask = "INDD:*.indd";
var myFile = myFolder.openDlg("Select Files To Open", myMask, true);

Kasyan