Copy link to clipboard
Copied
var doc = app.activeDocument;
var destFolder = Folder ("~/Documents");
if (destFolder) {
var fileName = activeDocument.name;
var destFile = new File(destFolder + '/' + fileName);
var psdExportOptions = new ExportOptionsPhotoshop();
// Set PSD export options
psdExportOptions.saveMultipleArtboards = true;
psdExportOptions.artboardRange = "1";
psdExportOptions.antiAliasing = false;
psdExportOptions.resolution = 300;
psdExportOptions.embedICCProfile = false;
psdExportOptions.writeLayers = false;
psdExportOptions.imageColorSpace = ImageColorSpace.CMYK;
doc.exportFile (destFile, ExportType.PHOTOSHOP, psdExportOptions);
}
This code I created exports my current Ai document as a PSD with set options. It also names the new file what it is called in Ai.
How can I call the created file and open it directly in Photoshop? Keep in mind I would be working on multiple files, so file names would change every time I ran this Export Script.
I could call a specifically named file and open that, but that's not what I need this script to do. I just need it to open the newly created PSD file. Any help would be greatly apreciated!!!
Hi Mark,
BridgeTalk or for simple commands like this, Interapp communication (Cross-DOM)
use photoshop.open(fileObject);
before that you need to build your newly exported file object
.
.
.
doc.exportFile (destFile, ExportType.PHOTOSHOP, psdExportOptions);
}
var psfile = new File(destFolder + '/' + fileName.split('.')[0] + '-01.psd');
if (psfile.exists) {
//alert('file exists')
photoshop.open(psfile);
}
else
alert('file does not exist');
Copy link to clipboard
Copied
There are folder properties for some of the generic locations…
Folder.myDocuments
You need the BridgeTalk class to communicate between apps you will find samples here in this forum…
Copy link to clipboard
Copied
Hi Mark,
BridgeTalk or for simple commands like this, Interapp communication (Cross-DOM)
use photoshop.open(fileObject);
before that you need to build your newly exported file object
.
.
.
doc.exportFile (destFile, ExportType.PHOTOSHOP, psdExportOptions);
}
var psfile = new File(destFolder + '/' + fileName.split('.')[0] + '-01.psd');
if (psfile.exists) {
//alert('file exists')
photoshop.open(psfile);
}
else
alert('file does not exist');