I'm using ExportOptionsSaveForWeb and it is replacing spaces in filenames with a "-".
The issue I'm having is when I later call to open that file, it no longer matches the filename variable, as the name has changed on save.
I require one of 2 options:
- Force the unix naming off (however the variable still will not match to open?)
or
- Force the unix naming on and replace all "%20" (or " "?) in the filename with "-"
Here is a basic version of what I'm doing (works fine if the filename has no spaces):
// the save
activeDocument.exportDocument(new File(saveFile),ExportType.SAVEFORWEB,pngOpts);
// later trying to open
var docRef = app.open(saveFile)
Is there a way to set the unix naming in JS? Ultimately, how can I open the file I just saved in JS?
Thanks
Filename variables with unix dashes
-
Mike Hale
Filename variables with unix dashes
You can't change the file naming for SFW via a script. You can either change in manually in the SFW dialog( the options are sticky so only need to be changed once ).
Or you can you can export using a temp name like temp042013.png then after it's exported rename the file using the File.rename method.
Or you can you can export using a temp name like temp042013.png then after it's exported rename the file using the File.rename method.