path problems

  • Thread starter Martijn Steinrucken
  • Start date
M

Martijn Steinrucken

Hello guys and girls,

I started scripting in photoshop with javascript a little while ago. I
am currently making a script that automatically saves a copy of a psd
as a resized TGA file in a user specified location. To get the file
path and name I use a file browser box.

saveFile = File.openDialog("Select a file", "Bitmaps: *.tga");

Now, to make it easier for the user, I want the selected path to be
saved with the psd file, so the next time the user wants to save that
file, he doesn't have to fill in the path again. To do this, I would
like to save

saveFile.absoluteURI (this contains the path as a string)

This works fine for short paths without spaces (eg. c:\test\test.tga).
But when the user selects a path that does contain spaces (eg.
c:\program files\test.tga), the string in saveFile.absoluteURI reads
"/c/program%20files/test.tga" and when the path gets a little longer
(eg. c:\documents and settings\my name\my documents\test.tga)
saveFile.absoluteURI reads "~my%20documents\test.tga" instead of the
whole path.

Does anyone know how to get around this problem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top