Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Setting start folder with Folder.selectDialog

Guest
Sep 27, 2012 Sep 27, 2012

Hi there, is it possible to define a start folder when using selectDialog ? It seems to start by default from the desktop, but would it be possible to start the search from let's say C:\some folder\some other folder\my indesign documents ?

This way I can save myself quite some clicks 🙂

Thanks,

Koen

TOPICS
Scripting
10.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Mentor , Sep 27, 2012 Sep 27, 2012

Hi,

If your start folder is myFolder

use

myFolder.selectDlg() to open dialog with myFolder selected.

hope...

Translate
Mentor ,
Sep 27, 2012 Sep 27, 2012

Hi,

If your start folder is myFolder

use

myFolder.selectDlg() to open dialog with myFolder selected.

hope...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 27, 2012 Sep 27, 2012

... and you must use selectSlg rather than selectDialog' which

"iffers from the object method selectDlg() in that it does not preselect a folder."

according to the JS reference.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 02, 2012 Oct 02, 2012

Thanks, did the trick indeed

Just in case someone else would like to do this, remember that your folder must have double slashes to make it work, did make me sweat for a while 🙂

example :

var selFolder = "D:\\somefolder\\somefolder\\here_we_are"

var myFolder = Folder(selFolder).selectDlg("Select a folder with InDesign files");

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 02, 2012 Oct 02, 2012

Better to use this:

var selFolder = "/D/somefolder/somefolder/here_we_are"

so that your script works on Macs too.

Peter

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 02, 2012 Oct 02, 2012

Hi,

I know it's the URI Path, but as 'D:' is the drivecharacter which is mapped over the drive will it work on a mac¿!

Hans-Gerd Classen

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 02, 2012 Oct 02, 2012

You've got me there. I don't know.

Peter

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 02, 2012 Oct 02, 2012

Hi,

don't wonna 'get you there', but wasn't aware of it till last sunday ...

Hans-Gerd

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Sep 27, 2012 Sep 27, 2012

from a recent script i did:

var myFolder=Folder(app.activeDocument.filePath).selectDlg("PDF folder:");

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 31, 2015 Jul 31, 2015
LATEST

Since the title doesn't specify inDesign, and other application users might end up here (like myself), here's how you do it in illustrator:


var dest = Folder(app.activeDocument.path).selectDlg();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines