Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

How does JavaScript handle spaces in a directory path for saveAs statement?

$
0
0

Greetings,

 

Below is a function I wrote that is supposed to save a file out as a jpeg to a specific subfolder on my machine. The directory path has several spaces and it's causing the function to fail. (There is a space in DCS Partnership and TAC Project below on line 2 of the function).

 

Does anyone know how to write a path in the new File object that has spaces in the path? (Maybe there's a special character to denote a single space??)

 

function saveScene (fileName){

    jpgFile = new File( "C/Temp/DCS Partnership/TAC Project/Scenes_Listellos" +  fileName);

    jpgSaveOptions = new JPEGSaveOptions();

    jpgSaveOptions.embedColorProfile = true;

    jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;

    jpgSaveOptions.matte = MatteType.NONE,

    jpgSaveOptions.quality = 12;

  docActive.saveAs(jpgFile, jpgSaveOptions, true, Extension.LOWERCASE);

      } // end function saveScene


Viewing all articles
Browse latest Browse all 12244

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>