Copy link to clipboard
Copied
Hello! This is my first post/question. I've been spending a couple days trying to work around this myself but haven't succeeded.
I've created a rather complex action within Photoshop (CC), and currently the only step in the action which requires manual input is the "Load files into Stack" script.
I'd like to use the "Load files into Stack" script but prevent all prompts/dialogues. I'd simply like to create a script which hard codes a folder location (filled with png files) so that the action can continue uninterrupted.
This feels "simple" enough to do, but I'm simply too unfamiliar with Photoshop scripting to get it to work myself (and I'm under a bit of a time constraint).
This post on the forum seemed promising, but it's not quite what I'm looking for, and I couldn't get it to work. The thread is quite old, so perhaps certain script lines are obsolete now: Would like to automate open stacks as layers + run action. Possible with script??
Cheers!
ps. I've asked this same question on another Photoshop forum, so apologies if you are seeing this twice.
Ah, found it I think. I added this in. I don't think it's 100% correct, but it does the job. A "Load Layers" layer sticks around, but that's not a big deal.
loadLayers.alignStack = function( stackDoc )
{
selectAllLayers(stackDoc, 0);
}
So I end up with this
...var folder = new Folder('~/MyFolder');
function runLoadStack(folderPath) {
var loadLayersFromScript = true;
// @include 'Load Files into Stack.jsx'
var fList = folder.getFiles('*.png')
var aFlag = true;
loadLayers.alignStack = functio
Copy link to clipboard
Copied
You can try this one...
var folder = new Folder('~/Desktop/MyFolder');
function runLoadStack(folderPath) {
var loadLayersFromScript = true;
// @include 'Load Files into Stack.jsx'
var fList = folder.getFiles('*.png')
var aFlag = true;
loadLayers.intoStack(fList, aFlag);
}
runLoadStack(folder)
Copy link to clipboard
Copied
Tom - thanks so much! However, there is one problem. The script loads the images and places them into layers (perfect!), however, after the last image is loaded, the script runs an "align content" adjustment which distorts all the layers. On top of that it takes a good 2-3 minutes to complete that step. Is there an easy way to prevent that part of the script?
Each of these layers is created by an image that is the same size, but as you can see, they've been distorted to random shapes/sizes.
Copy link to clipboard
Copied
Ah, found it I think. I added this in. I don't think it's 100% correct, but it does the job. A "Load Layers" layer sticks around, but that's not a big deal.
loadLayers.alignStack = function( stackDoc )
{
selectAllLayers(stackDoc, 0);
}
So I end up with this
var folder = new Folder('~/MyFolder');
function runLoadStack(folderPath) {
var loadLayersFromScript = true;
// @include 'Load Files into Stack.jsx'
var fList = folder.getFiles('*.png')
var aFlag = true;
loadLayers.alignStack = function( stackDoc )
{
selectAllLayers(stackDoc, 0);
}
loadLayers.intoStack(fList, aFlag);
}
runLoadStack(folder)