Skip to main content
Participant
March 4, 2022
Question

Who knows what this command script code is? As shown in the screenshot--export for screens

  • March 4, 2022
  • 1 reply
  • 323 views

exprort selection project ~export for screens As shown in the screenshot set image dpi

This topic has been closed for replies.

1 reply

Charu Rajput
Community Expert
Community Expert
March 4, 2022

Hi,

I am not able to understand your question completely. But if I am not wrong and your are looking for the script that exports the selected items, you can try the following

var doc = app.activeDocument;
var docAssets = doc.assets;
var assetIDArray = new Array();
var itemToExport = new ExportForScreensItemToExport();
itemToExport.artboards = '';
itemToExport.document = false;
var assetArray = new Array();
for (var i = 0; i < app.selection.length; i++) {
    var asset = docAssets.add(app.selection[i]);
    assetIDArray.push(asset.assetID);
}
itemToExport.assets = assetIDArray;
var options = new ExportForScreensOptionsPNG24();
app.activeDocument.exportForScreens(File('~/Desktop'), ExportForScreensType.SE_PNG24, options, itemToExport);
Best regards