I am writing a script that allows me to do some basic overlay inside InDesign CS3, and one of my tasks is to open a dialog that allows the user to select a file to place. I am currently doing this with:
var file = File.openDialog("Choose a File:");
The problem is that when switching to a network drive using a shortcut. For some reason, the dialog box sees it as a file and returns this path from the dialog box rather than going to the folder. I assume that this is just a mistake in the dialog box, and my initial thought was to check to see if the returned file has the correct extension, and if not, display the dialog again, opening the path to the returned path. However, I cannot find a way to change where it opens by default; openDlg()has only parameters for String prompt, var filterand boolean multiselect. I am not familiar with Javascript, so I do not know if this is something a general solution or specific to InDesign.
EDIT . If anyone is interested, here is the last code I used to get around the problem:
var path = new File("~/desktop");
var file = path.openDlg("Choose File:");
while (file.alias) {
file = file.resolve().openDlg("Choose File:");
}
, , (), , . , . , , , , null.