ContactSheet problem
Hi all,
I've made a ContactSheet script that makes a contact sheet from all the images in a folder and it works fine. And it looks like this:
var myFolder = Folder.selectDialog("Select Folder");
var myFileList = myFolder.getFiles();
//Set ContactSheet II parameters
function createContactSheet(folderName){
var id = stringIDToTypeID( "0B71D221-F8CE-11d2-B21B-0008C75B322C" );
var desc1 = new ActionDescriptor();
var idCSIISettings = stringIDToTypeID( "CSIISettings" );
desc1.putString( idCSIISettings, '<ContactSheetIISettings>'+
'<source imageSource="Folder" path="'+ folderName +'" includeSubfolders="false" groupImages="false"/>'+
'<document units="cm" width="41" height="27.7" resolution="300" resUnits="pixels/inch" mode="CMYK Color" bitDepth="8-bit" colorProfile="Working CMYK" flattenLayers="true"/>'+
'<thumbnail place="across first" cols="' + myColumns + '" rows="' + myRows + '" bestFit="true" useAutospacing="true" horz="0.014 in" vert="0.014 in"/>'+
'<caption enabled="true">'+
'<font name="ArialMT" size="9.5"/>'+
'</caption>'+
'</ContactSheetIISettings>' );
var idMsge = charIDToTypeID( "Msge" );
desc1.putString( idMsge, "Settings for Contact Sheet II" );
executeAction( id, desc1, DialogModes.NO);
}
//Hides the ContactSheet II dialog window, but in order to work it's necessary to edit Photoshop's ContactSheet.jsx
$.setenv("NoUI", true);
createContactSheet(myFolder);
Now I'm trying to make a similar script, but instead of picking a folder, I need to select certain files. So I changed the script to this:
var myFileList = File.openDialog("Select a File:","*.jpg;*.eps;*.tif;*.psd",true);
var myFolder = myFileList[0].path;
//Set ContactSheet II parameters
function createContactSheet(filesName){
var id = stringIDToTypeID( "0B71D221-F8CE-11d2-B21B-0008C75B322C" );
var desc1 = new ActionDescriptor();
var idCSIISettings = stringIDToTypeID( "CSIISettings" );
var folderName=filesName[0].parent.fsName;
desc1.putString( idCSIISettings, '<ContactSheetIISettings>'+
'<source imageSource="Files" path="'+ folderName +'" includeSubfolders="false" groupImages="false"/>'+
'<document units="cm" width="41" height="27.7" resolution="300" resUnits="pixels/inch" mode="CMYK Color" bitDepth="8-bit" colorProfile="Working CMYK" flattenLayers="true"/>'+
'<thumbnail place="across first" cols="' + myColumns + '" rows="' + myRows + '" bestFit="true" useAutospacing="true" horz="0.014 in" vert="0.014 in"/>'+
'<caption enabled="true">'+
'<font name="ArialMT" size="9.5"/>'+
'</caption>'+
'</ContactSheetIISettings>' );
var idMsge = charIDToTypeID( "Msge" );
desc1.putString( idMsge, "Settings for Contact Sheet II" );
executeAction( id, desc1, DialogModes.NO);
}
//Hides the ContactSheet II dialog window, but in order to work it's necessary to edit Photoshop's ContactSheet.jsx
$.setenv("NoUI", true);
createContactSheet(myFileList);
But it doesn't work. Any ideas are more than welcomed.
Thanks.
