🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.photoshop.scripting
6 messages
6 total messages Started by DavidGregg Fri, 23 Jan 2009 23:41
How to open two images, combine them, and save?
#418
Author: DavidGregg
Date: Fri, 23 Jan 2009 23:41
3 lines
969 bytes
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...
Re: How to open two images, combine them, and save?
#419
Author: Larry G. Schneider
Date: Sat, 24 Jan 2009 01:04
1 lines
672 bytes
<http://www.adobeforums.com/webx/.59b755e9/3>
Re: How to open two images, combine them, and save?
#420
Author: DavidGregg
Date: Sat, 24 Jan 2009 02:57
1 lines
829 bytes
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.
Re: How to open two images, combine them, and save?
#421
Author: try67
Date: Sat, 24 Jan 2009 14:04
2 lines
709 bytes
Hi David, I can write for you a script that will do that.
Contact me by email for more details.
Re: How to open two images, combine them, and save?
#33
Author: Andrew_Chawner
Date: Sun, 29 Mar 2009 21:07
3 lines
707 bytes
It would be great if someone could share a solution to this in the forum..

It would be really useful...
Re: How to open two images, combine them, and save?
#36
Author: Mark_Larsen
Date: Mon, 30 Mar 2009 10:45
88 lines
3750 bytes
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 &#8800; 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads