• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Open an Exported File directly in Photoshop (after exported file created)

Guest
Sep 18, 2013 Sep 18, 2013

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!!!

TOPICS
Scripting

Views

657

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 18, 2013 Sep 18, 2013

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');

Votes

Translate

Translate
Adobe
Guru ,
Sep 18, 2013 Sep 18, 2013

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…

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2013 Sep 18, 2013

Copy link to clipboard

Copied

LATEST

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');

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines