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

Having trouble with the File and Folder Objects (PSCS3 javascript on Win)

New Here ,
May 22, 2008 May 22, 2008

Copy link to clipboard

Copied

I'm having trouble successfully creating a new folder on my windows platform, using javascripts in photoshop. In ExtendScript Toolkit 2, set to Adobe Photoshop CS3, I've tried:

var myFolder = new Folder("/c/Documents and Settings/vcastelo/My Documents");
myFolder.create();

and

var myFolder = new Folder("/c/Documents and Settings/vcastelo/My Documents");

is this right? what am I doing wrong? It's pretty basic stuff, I know but I can't figure is out... any help would be greatly appreciated.
TOPICS
Actions and scripting

Views

421

Translate

Translate

Report

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
Adobe
Valorous Hero ,
May 22, 2008 May 22, 2008

Copy link to clipboard

Copied

Try this:
var myFolder = new Folder("c:/Documents and Settings/vcastelo/My Documents");
myFolder.create();

Votes

Translate

Translate

Report

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
New Here ,
May 22, 2008 May 22, 2008

Copy link to clipboard

Copied

thanks paul,
but no luck. it supposed to create a folder in my documents folder right?

Votes

Translate

Translate

Report

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 ,
May 22, 2008 May 22, 2008

Copy link to clipboard

Copied

Is the drive designation case sensitive?

Votes

Translate

Translate

Report

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
New Here ,
May 22, 2008 May 22, 2008

Copy link to clipboard

Copied

oh I see, I just figured it out... the drive designation isn't case sensitive... but i didn't add the name of new folder to the destination path. This works now:

var myFolder = new Folder("c:/Documents and Settings/vcastelo/My Documents/data");
myFolder.create();

where "data" is the name of the new folder in "My Documents"
Thanks guys. keep scripting!
vergo_O

Votes

Translate

Translate

Report

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 ,
May 22, 2008 May 22, 2008

Copy link to clipboard

Copied

LATEST
vergcastelo@adobeforums.com wrote:
> oh I see, I just figured it out... the drive designation isn't case sensitive... but i didn't add the name of new folder to the destination path.

Yep.
>
> var myFolder = new Folder("c:/Documents and Settings/vcastelo/My Documents/data");
> myFolder.create();

The "/c/Documents and Settings/vcastelo/My Documents/data" form works, too, and
should be preferred.

Here's an extreme example as to why this is a good idea:
I work in an XP/cygwin environment, so I added links to all of my drives in my
root cygwin folder. As a result, the path /p/Pictures/2008-05-05 is the same on
the bash command line (and other tools) as it is in PSJS. I carried this over to
my Mac, as well. I mount P: drive in OSX then setup links so that
/p/Pictures/2008-05-05 is also the same on the Mac. This has vastly simplified
my work. The only time I use system-specific pathnames is in a script's UI.

-X
--
for photoshop scripting solutions of all sorts
contact: xbytor@gmail.com

Votes

Translate

Translate

Report

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