Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to open two images, combine them, and save?

New Here ,
Jan 23, 2009 Jan 23, 2009
I'm trying to make an action that will open two images, they are named "imagename" and "imagename-off". I want to resize the canvas on "imagename" and copy "imagename-off" to "imagename" and then save "imagename". Then close both files.

I have hundreds of files to combine this way and it would be a great help for any assistance...
TOPICS
Actions and scripting
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Jan 23, 2009 Jan 23, 2009
http://www.adobeforums.com/webx/.59b755e9/3
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 23, 2009 Jan 23, 2009
I do not understand how that thread helps me. My images have very different names. I need to be able to open the first image in the folder, then it's -off version and make the proper changes, then move on to the next non -off image.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 24, 2009 Jan 24, 2009
Hi David, I can write for you a script that will do that.
Contact me by email for more details.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 29, 2009 Mar 29, 2009
It would be great if someone could share a solution to this in the forum..

It would be really useful...
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 30, 2009 Mar 30, 2009
LATEST
A basic AppleScript solution shared

set Folder_A to choose folder with prompt "Where are the images to resize" without invisibles
set Folder_B to choose folder with prompt "Where are the images to duplicate?" without invisibles
--
set This_Date to do shell script "date \"+%d-%m-%y\""
--
tell application "Finder"
set File_List_A to files in Folder_A
set Count_A to count of files in folder Folder_A
set File_List_B to files in Folder_B
set Count_B to count of files in folder Folder_B
if Count_A ≠ Count_B then ¬
display dialog "You have an uneven amount of pictures!!!" & return & "Check your folders and try again" buttons {"Cancel"} default button "Cancel"
if not (exists folder ("Combined Images " & This_Date) of desktop) then
set New_Folder to make new folder at desktop with properties ¬
{name:"Combined Images " & This_Date}
else
set New_Folder to folder ("Combined Images " & This_Date) of desktop
end if
end tell
--
tell application "Adobe Photoshop CS2"
set User_Notifiers to notifiers enabled
set User_Rulers to ruler units of settings
set User_Dialogs to display dialogs
set notifiers enabled to false
set ruler units of settings to pixel units
set display dialogs to never
set foreground color to {class:RGB color, red:0.0, green:0.0, blue:0.0}
set background color to {class:RGB color, red:255.0, green:255.0, blue:255.0}
end tell
--
repeat with i from 1 to Count_A
tell application "Finder"
set File_A to item i of File_List_A as alias
-- set File_Name_A to name of File_A
set File_B to item i of File_List_B as alias
-- set File_Name_B to name of File_A
end tell
tell application "Adobe Photoshop CS2"
activate
open File_B
set Doc_Ref_B to the current document
tell Doc_Ref_B
set Pixel_Height to height
set Pixel_Width to width
end tell
open File_A
set Doc_Ref_A to the current document
tell Doc_Ref_A
resize canvas height Pixel_Height
resize canvas width Pixel_Width
end tell
set the current document to Doc_Ref_B
duplicate layer 1 of Doc_Ref_B to Doc_Ref_A
close Doc_Ref_B without saving
tell Doc_Ref_A
-- do your stuff here
set Doc_Name to name of Doc_Ref_A
set Base_Name to my getBaseName(Doc_Name)
set New_File_Path to (New_Folder as string) & Base_Name & "_Comp.tif"
save Doc_Ref_A in file New_File_Path as TIFF with options ¬
{byte order:Mac OS, embed color profile:true, image compression:LZW, save alpha channels:false, save layers:true} appending lowercase extension
end tell
close current document without saving
end tell
end repeat
--
beep 3
--
tell application "Adobe Photoshop CS2"
set notifiers enabled to User_Notifiers
set ruler units of settings to User_Rulers
set display dialogs to User_Dialogs
display dialog "All Done" giving up after 6
end tell
--
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines