Skip to main content
Loic.Aigon
Legend
June 2, 2008
Question

OpenDialog to a specific folder

  • June 2, 2008
  • 26 replies
  • 4393 views
Hi,
I saw this question was discussed already but following the tip, I don't have any success. Moreover I couldn't post in the thread so I have to open this topic. Sorry about that.

Well,
here is the matter :
var myfile = File("\\192.168.1.1\Marketing\17. Produits\COPY\Tiff_CMYK_300dpi\ok\copyripok_uk.tif");
myfile.openDialog(); // > ERROR

/*

File.openDialog() // Works great.

*/

So it's so annoying. Where am I wrong ?
Thanks for help
Loic
This topic has been closed for replies.

26 replies

Inspiring
August 17, 2008
On 17/8/08 11:02 PM, "Dave Saunders" <member@adobeforums.com> wrote:<br /><br />> they are returned to ExtendScript as folders, not files<br /><br />Presumably only if they are packaged as bundles; these days that's pretty<br />much all apps, but older ones might not be. And some "files" are also<br />packages and therefore presumably returned as folders, although they're much<br />rarer.<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au>
Inspiring
August 17, 2008
I've just realized why it is not at all odd that (as I said in message 9) "...no matter what you do, application files are always active..."

The reason is that they are returned to ExtendScript as folders, not files, so my previous code that explicitly tested for files with a .app extension was on the right track but in the wrong place. If you want to exclude applications, you need to add logic to the folder detection code, returning false if the folder name ends in .app.

You can check this by running:

#target indesign
alert(app.fullName.constructor.name)

It displays an alert that says Folder.

Dave
Loic.Aigon
Legend
August 13, 2008
What about posting a new topic called "CS2 openDialog problem" ?
It's true that if Olav can answer to your problem, it's better that anyone can enjoy it.
Loic
August 13, 2008
Hi Loic,

I normally don't send private emails regarding forum posts but maybe this time I will.

However, what other options do I have before I email Olav?

Regards
Norbert
Loic.Aigon
Legend
August 12, 2008
okvern at adobe.com at the last resort :-)
August 12, 2008
How does one get in touch with Olav to rea a particlar thread? Or does he read all thats posted here??
Loic.Aigon
Legend
August 11, 2008
Well effectively the formulation of the explanation let think that you can select multiple files but the command doesn't.
Weird, either the explanation is false, either we misunderstood a point.
Olav will be welcome to clear that stuff !
August 10, 2008
Hi Loic,

You are right. Page 540 of the CS2 scripting guide does say:

"A file or files to be preselected when the dialog opens:"

However myFile=File.openDialog("Pick me","Files : *.indd", true);

Doesn't aqllow multiple selections.

So is the CS2 Scripting guide wrong or am I doing something wrong?

Regards
Norbert
Loic.Aigon
Legend
August 8, 2008
Have a look on page 540 of the Indesign CS2 scripting reference :
openDialog
File.openDialog
([prompt][,select])
prompt
Optional. A string containing the prompt text, if the dialog allows a prompt.
select
Optional. A file or files to be preselected when the dialog opens:
In Windows, a string containing a comma-separated list of file types with descriptive
text, to be displayed in the bottom of the dialog as a drop-down list from which the user can select which types of files to display.
Each element starts with the descriptive text, followed by a colon and the file search masks for this text, separated by semicolons. For example, to display two choices, one labeled Text Files that allows selection of text files with extensions .TXT and .DOC, and the other labeled All files that allows selection of all files:
Text Files:*.TXT;*.DOC,All files:*
So it seems CS2 won't set capacity to allow multiple selecting files
So you have to use a workaround.
Folder.getFiles() with a indd selection could do the trick but it implies that it will get ALL the files available and not the one the user may only want...
BUT you know what ? Why don't you just giv a try and maybe in CS2 multi opening will be allowed with the File.openDialog method without any need to set anything ?
For more precise informations, I give my place to specialists :-)
August 8, 2008
Hi Dave,

I just tried the code on CS3 and it allows me to select multiple files.

So I am guessing that the code does not work for CS2 to multi select.

However, in CS2's user interface when I do a File---> Open, it allows me to do a multi select.

Any suggestions?

Regards
Norbert