Instead of putting my picture in the same folder as the current one, I would like to move it one step up the folder structure.
Is this possible???
Because i tried it with ../ as i found in some descriptions and nothing happend...

I hope somebody could help me out or give me a hint

Thx, Bardioch
Code: Select all
var thedoc=app.activeDocument;
var docName = thedoc.name;
if (docName.indexOf(".") != -1) {var basename = docName.match(/(.*)\.[^\.]+$/)[1]}
else {var basename = docName};
try {var docPath = thedoc.path}
catch (e) {var docPath = "~/Desktop"};
var folderString = docPath+"/FolderABC"; //Thats where i want to make one step up in folder structure
var theCopy = thedoc.duplicate(basename,false);
OutFoldJPEG(folderString,basename,12,true,MatteType.NONE,Extension.LOWERCASE);
theCopy.close(SaveOptions.DONOTSAVECHANGES);
function SaveJPEG(saveFile, jpegQuality,cProfile,MType,fCase){
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = cProfile;
jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgSaveOptions.matte = MType;
jpgSaveOptions.quality = jpegQuality;
activeDocument.saveAs(saveFile, jpgSaveOptions, true,fCase);
}
function OutFoldJPEG(docPath,dnme,jpegQuality,cProfile,MType,fCase){
var outfolder = new Folder(docPath)
if (outfolder.exists == false){
outfolder.create();
var saveFile = new File(outfolder + "/" + dnme);
SaveJPEG(saveFile, jpegQuality,cProfile,MType,fCase);}
else{
var saveFile = new File(outfolder + "/" + dnme);
SaveJPEG(saveFile, jpegQuality,cProfile,MType,fCase);}
}