Complex Action problems please help

AN
Posted By
andy_nelson
Sep 14, 2006
Views
185
Replies
5
Status
Closed
Hey, I am trying to write an action to do the following (please help me if you know how):

Open files sequentially from two different folders..

1, That is open a file from folder (A) then folder (B)

2, Apply some changes i.e. merging the two files together with a blending mode change

3, Saving that outcome and closing the orginal files without any changes to them

4, Then allowing the action to do that for each file in the folder..

i..e merging file 1 in folder (A) with file 1 in folder (B) then file two in (A) with file two in (B).. and so on for all the sequential files in each folder.

I cannot work out how to do this.. Please please help me if you know how. Thanks, Andy.

How to Improve Photoshop Performance

Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!

AN
andy_nelson
Sep 14, 2006
For some reason B came out as a smiley with glasses?
FE
Fraser_Edward_Crozier
Sep 14, 2006
You might want to add an applescript into the mix so that you can minmise the amount of external calls the action makes.
CN
Cybernetic Nomad
Sep 14, 2006
Actually, I think you will need scripting to do this.

Check out the PS Scripting forum for better help on the matter:

<http://www.adobeforums.com/cgi-bin/webx?13@@.3bbf2765>
ML
Mark_Larsen
Sep 15, 2006
Andy, if you want this as Applescript I can try to help. No guarantees… I have done several similar tasks before. It’s much easier to script when you have the files in front of you, you know exactly what your dealing with then. Let me know if you want to try this? I will need some more info about it though.
ML
Mark_Larsen
Sep 15, 2006
Andy, its almost time for me to call it a day here in the UK. Here is a sample of some code that will do this. Have a try with some test files and see if it works for you. Others may be able to help in fine tuning the syntax to your requirements if not back in on monday. Any questions post back in the scripting forum so not to bug the users of the main PS forum.

set inputFolderA to choose folder with prompt "Select a folder of images that you want at the bottom of your files?"
set inputFolderB to choose folder with prompt "Select a folder of images that you want at the top of your files?"
set outputFolder to choose folder with prompt "Select a folder to save the new images to?"

tell application "Finder"
set filesListA to files in inputFolderA
set countA to count of files in folder inputFolderA
set filesListB to files in inputFolderB
set countB to count of files in folder inputFolderB
if (countA) ? (countB) then display dialog "You have an uneven amount of pictures!!! check your folders and try again…"
end tell

repeat with i from 1 to countA
tell application "Finder"
set theFileA to item i of filesListA as alias
set theFileB to item i of filesListB as alias
end tell

tell application "Adobe Photoshop CS"
activate
set display dialogs to never
set UserPrefs to properties of settings
set ruler units of settings to pixel units
set background color to {class:RGB color, red:255, green:255, blue:255} set foreground color to {class:RGB color, red:0, green:0, blue:0} —
open theFileA
set docRefA to the current document
set docHeightA to height of docRefA — This is for if you require some repositioning!!! set docWidthA to width of docRefA — This is for if you require some repositioning!!! —
open theFileB
set docRefB to the current document
tell docRefB
set docHeightB to height of docRefB — This is for if you require some repositioning!!! set docWidthB to width of docRefB — This is for if you require some repositioning!!! set docName to name of docRefB
set docBaseName to getBaseName(docName) of me — Getting the name of the second file to use for layer name
duplicate layer 1 to beginning of docRefA
end tell
close docRefB without saving

tell docRefA
set properties of layer 1 to ¬
{name:docBaseName, blend mode:multiply, opacity:50.0} — Here are options for mode & opacity set docName to name of docRefA
set docBaseName to getBaseName(docName) of me
set newFileName to (outputFolder as string) & docBaseName & "_Mixed" — You new files naming.
save docRefA in file newFileName as Photoshop format with options ¬ {class:Photoshop save options, save alpha channels:true, save spot colors:true, embed color profile:true, save layers:true} ¬
appending lowercase extension with copying
end tell
close current document without saving
set ruler units of settings to ruler units of UserPrefs
end tell
end repeat

on getBaseName(fName)
set baseName to fName
repeat with idx from 1 to (length of fName)
if (item idx of fName = ".") then
set baseName to (items 1 thru (idx – 1) of fName) as string exit repeat
end if
end repeat
return baseName
end getBaseName

Must-have mockup pack for every graphic designer 🔥🔥🔥

Easy-to-use drag-n-drop Photoshop scene creator with more than 2800 items.

Related Discussion Topics

Nice and short text about related topics in discussion sections