How to get around layers when automating a process

Discussion of Automation, Image Workflow and Raw Image Workflow

Moderators: Tom, Kukurykus

MacDaniels

How to get around layers when automating a process

Post by MacDaniels »

I am attempting to create my first script in Photoshop but I am stuck on the layers problem (I don't know if it's just me that has come across this inconvenience). I am doing some contact sheets and they need to have two types of captions, the name and the item number. I have to figure that one out because photoshop's "Contact Sheet II" automation does not give you the option for any caption other than the name of the file. I also need photoshop to create folders for each layered set of elements so that I can group them together. I recorded a script using the script listener plug-in but the script stops every time the computer handles layers through names because the name of the layers are specified, hence for me to use the script on another file I would have to name each file's layers the same. How can I tell the program to place a folder on top of each specific layer? Is there a way that I can just let photoshop do what I need it to do regardless of the layer names?

Here is a sample of the code in JS

/*PART1: This script creates a folder on top of each set of two layers.
First layer is a text layer, second layer is a picture layer AND SO AND SO.*/


//First two loayers//

//=======================================================\

var id479 = charIDToTypeID( "slct" );\
var desc107 = new ActionDescriptor();\
var id480 = charIDToTypeID( "null" );\
var ref70 = new ActionReference();\
var id481 = charIDToTypeID( "Lyr " );\
ref70.putName( id481, "C01830WCN.psd" );\
desc107.putReference( id480, ref70 );\
var id482 = charIDToTypeID( "MkVs" );\
desc107.putBoolean( id482, false );\
executeAction( id479, desc107, DialogModes.NO );\
\
//=======================================================\

Please, how can I make photoshop run it's course? Sorry if these questions are too vague.

Thanks
Patrick

How to get around layers when automating a process

Post by Patrick »

Sorry I am a little unclear about what you are trying to do - when you say put a folder on top of each set of two layers, do you mean moving them into a layerset (folder)?
xbytor

How to get around layers when automating a process

Post by xbytor »

You may be able to specify the layer by index instead of name.

Or you could take a look at ContactSheetX:
http://ps-scripts.sourceforge.net/Conta ... X/csx.html ... X/csx.html

You can specify multi-line captions. It's not clear to me, however, where the item number is coming from. If it's in the images' metadata, it should be a pretty easy 0 lines of code solution. If the item number is coming from somewhere else, you would have to write a bit of script that CSX would execute after each sheet is processed (before it is saved and closed).

-X
MacDaniels

How to get around layers when automating a process

Post by MacDaniels »

Sorry I am a little unclear about what you are trying to do - when you say put a folder on top of each set of two layers, do you mean moving them into a layerset (folder)?

Exactly, however the code is for creating the layers on top of the layersets before they are to be added. The layersets in the appropiate folder are the goal, of course.

I tried Contact Sheet X but for some reason, everytime I ran it, Photoshop would quit on me. It produced a file but was unreadable. Uninstalled it reinstalled it.
same thing.