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

open as linked smart object

$
0
0

Hello,

 

iam looking for a solution to open files in a folder

and copy then into a document.

Its working good, but i need the files to be linked smart object.

 

Anyone knows a solution ?

 

Here my Code so far:

See in line 33. Convert to smart object: ?

 

var file = new File('C:/User_MY PATH.PSD'),
docRef = open(file);




// Use the path to the application and append the samples folder
var samplesFolder = Folder('C:/USERS_MY FOLDER');


//Get all the files in the folder
var fileList = samplesFolder.getFiles()


  // open each file  for (var i = 0; i < fileList.length; i++)  {  // The fileList is folders and files so open only files  if (fileList[i]instanceof File)  {  open(fileList[i])  // use the document name for the layer name in the merged document  var activeDocName = app.activeDocument.name;  var targetDocName = activeDocName.substring(0, activeDocName.lastIndexOf("."));  // Copy the Document  app.activeDocument.selection.selectAll()  //convertToSmartObject(); THIS ISNT WORKING - CONVERT IT ?  app.activeDocument.selection.copy()  // don’t save anything we did  app.activeDocument.close(SaveOptions.DONOTSAVECHANGES)  //Select specific layer to paste the copy, this is to make sure the layers are in a specific position  var doc = app.activeDocument;  doc.activeLayer = doc.artLayers.getByName("bgr");  //Paste Document  app.activeDocument.paste()  app.activeDocument.activeLayer.name = targetDocName  }  };

Viewing all articles
Browse latest Browse all 12244

Trending Articles



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