Friday, March 26, 2010

Invoking ''Load Files Into Stack閳? from...

I have an Applescript that gathers a bunch of JPEGs, which I then combine into a PSD with File -%26gt; Scripts -%26gt; Load Files Into Stack閳?/p>

However, I'd like to automate that final step if possible. Can I send a list of files to the Load Files Into Stack script from my Applescript?

Invoking ''Load Files Into Stack閳? from...

Let me add that it does occur to me I could open all the files and use UI scripting to call the script, click the ''Add Open Files'' button, then click OK. However, that won't work if there are any other files open in Photoshop at the time, which is why I ask. Thank you.

Invoking ''Load Files Into Stack閳? from...

I'm not sure if or how Applescript can pass an array of file objects but the javascript function below accepts an array and stacks without a dialog. You will need to edit the include path to match your system

function runLoadStack( fList ){
?var loadLayersFromScript = true;// must be set before the include
?// @include '/C/Program Files/Adobe/Adobe Photoshop CS4/Presets/Scripts/Load Files into Stack.jsx'
?var aFlag = true;
?loadLayers.intoStack( fList, aFlag );
}

Thank you! Is there way I can pass just the name of the folder that contains the images I want in the stack? I explored the .jsx file but couldn't quite figure it out. That may save me the trouble of figuring out how to pass an Applescript list as a JavaScript array.

If you can pass the full path to the folder as a string this should work.

function runLoadStack( folderPath ){// full path as String
?var loadLayersFromScript = true;// must be set before the include
?// @include '/C/Program Files/Adobe/Adobe Photoshop CS4/Presets/Scripts/Load Files into Stack.jsx'
?var folder = new Folder( folderPath );
?var fList = folder.getFiles('*.jpg')
?var aFlag = true;
?loadLayers.intoStack( fList, aFlag );
}

No comments:

Post a Comment