I think I have found the problem. I went over to someone's house who still uses CS3.
It looks like Adobe never tested calling Load Files into Stack from another script. The function loadLayers.intoStack calls another function that does not exists. The loadLayers.doInteractiveLoad function which is called when running Load Files into Stack from the menu calls a different function ( loadLayers.stackLayers ). I guess Adobe changed the script or renamed that function and forgot to update both functions that use it.
If you are willing to edit the Load Files into Stack script the script I posted will work on CS3. Note - I think editing is the only way you will be able to call Load Files into Stack from another script even if you don't want to use my example.
To edit the script open it in either ExtendScript Toolkit( which ships with CS3 ) or a plain text editor. Replace the last two line of the loadLayers.intoStack function with these two lines.
Code: Select all if (this.stackElements.length > 1)
this.stackLayers();
With that edit loadLayers.intoStack will call the same function as loadLayers.doInteractiveLoad.
Batch Import/Resize/Placement
-
Mike Hale
Batch Import/Resize/Placement
IF you don't want to edit the Adobe script, the following should work on CS3 as well as newer versions.
Code: Select allvar loadLayersFromScript = true;// must be defined before including Load Files into Stacks.jsx
var StacksScriptPath = app.path + "/" + localize("$$$/ScriptingSupport/InstalledScripts=Presets/Scripts/")+"/Load Files into Stack.jsx";
$.evalFile( StacksScriptPath );
//redefine function for CS3
loadLayers.intoStack = function(filelist, alignFlag){
if (typeof(alignFlag) == 'boolean')
loadLayers.useAlignment = alignFlag;
if (filelist.length < 2)
{
alert(localize("$$$/AdobeScripts/Shared/LoadLayers/AtLeast2=At least two files must be selected to create a stack."), this.pluginName, true );
return;
}
var j;
this.stackElements = new Array();
for (j in filelist)
{
var f = filelist[j];
this.stackElements.push( new StackElement( (typeof(f) == 'string') ? File(f) : f ) );
}
if (this.stackElements.length > 1)
this.stackLayers();// in CS3 this calls a nonexistant function.
}
// create new stacked document
var selectedFolder = Folder.selectDialog( "Please select folder to stack");
if(selectedFolder != null ){// make sure user selected a folder and didn't cancel the dialog
var files = selectedFolder.getFiles(/.jpg$/i);// get only the jpg files in the selected folder,
if( files.length > 1 ){// make sure that there is at least two files to process
loadLayers.intoStack( files );// load the found files into a stack
var stackDoc = app.activeDocument;
// resizing document will resize all the layers
stackDoc.resizeImage (new UnitValue(286,'px'), undefined, undefined, ResampleMethod.BICUBIC);
// resize canvas to new page size
// arrange layer on page
}
}
Code: Select allvar loadLayersFromScript = true;// must be defined before including Load Files into Stacks.jsx
var StacksScriptPath = app.path + "/" + localize("$$$/ScriptingSupport/InstalledScripts=Presets/Scripts/")+"/Load Files into Stack.jsx";
$.evalFile( StacksScriptPath );
//redefine function for CS3
loadLayers.intoStack = function(filelist, alignFlag){
if (typeof(alignFlag) == 'boolean')
loadLayers.useAlignment = alignFlag;
if (filelist.length < 2)
{
alert(localize("$$$/AdobeScripts/Shared/LoadLayers/AtLeast2=At least two files must be selected to create a stack."), this.pluginName, true );
return;
}
var j;
this.stackElements = new Array();
for (j in filelist)
{
var f = filelist[j];
this.stackElements.push( new StackElement( (typeof(f) == 'string') ? File(f) : f ) );
}
if (this.stackElements.length > 1)
this.stackLayers();// in CS3 this calls a nonexistant function.
}
// create new stacked document
var selectedFolder = Folder.selectDialog( "Please select folder to stack");
if(selectedFolder != null ){// make sure user selected a folder and didn't cancel the dialog
var files = selectedFolder.getFiles(/.jpg$/i);// get only the jpg files in the selected folder,
if( files.length > 1 ){// make sure that there is at least two files to process
loadLayers.intoStack( files );// load the found files into a stack
var stackDoc = app.activeDocument;
// resizing document will resize all the layers
stackDoc.resizeImage (new UnitValue(286,'px'), undefined, undefined, ResampleMethod.BICUBIC);
// resize canvas to new page size
// arrange layer on page
}
}
-
Tim.Belt
Batch Import/Resize/Placement
Thank you so much! For the moment it seems to be working! Now I'm going to start on adding a way to load the pictures alphabetically into a grid, i'm sure it's possible with some perseverance! Thank you so much for the help, i cannot express that enough.