Opening a list of files in photoshop cs3

Here’s what I’m doing:

  1. set x to choose folder
  2. set imagelist to files in x
  3. open imagelist in photoshop cs3

Here’s where I’m at:
set pbFold to choose folder
set imagelist to (files in pbFold)
tell application “Adobe Photoshop CS3”
create contact sheet from files imagelist with options {caption:false, column count:1, height:1800, resolution:300, row count:4, width:600}
save current document in pbFold
close current document
end tell

Applescript Error:
Can’t get every file of alias “Unlimited Boundaries:Users:Brady:Desktop:Test:”.

I know my failure is in setting the list of files to imagelist but I can’t find a source for a solution. Any help would be appreciated.

Hi,

AppleScript has no idea to get the files of a folder,
ask the Finder or System Events to do the job


set pbFold to choose folder
tell application "Finder" to set imagelist to (files of pbFold as alias list)
tell application "Adobe Photoshop CS3"
	create contact sheet from files imagelist with options {caption:false, column count:1, height:1800, resolution:300, row count:4, width:600}
	save current document in pbFold
	close current document
end tell

if you use Tiger, you need this code


.
tell application "Finder"
	try
		set imagelist to (files of pbFold as alias list)
	on error
		set imagelist to (files of pbFold as alias as list)
	end try
end tell
.

Alright, thanks! That fixed it.
Do you have any idea why when I use photoshop cs3 in my applescripts, the first time I send an action to it, it tells me:
Adobe Photoshop CS3 got an error: General Photoshop error occurred. This functionality may not be available in this version of Photoshop.

  • Could not complete the Contact Sheet II command because a command was not available.
    but then after that, it works fine. Here’s the portion of my script, so you can see if I’m doing anything wrong:
	set image1 to ((pbFolder as text) & "1.jpg")
	set image2 to ((pbFolder as text) & "2.jpg")
	set image3 to ((pbFolder as text) & "3.jpg")
	set image4 to ((pbFolder as text) & "4.jpg")
	set image5 to ((pbFolder as text) & "ContactSheet-001.psd")
	set image6 to ((pbFolder as text) & "ContactSheet-001 copy.psd")
	set imagelist to {image1, image2, image3, image4}
	set imagelist2 to {image5, image6}
	
	tell application "Adobe Photoshop CS3"
		create contact sheet from files imagelist with options {caption:false, column count:1, height:1800, resolution:300, row count:4, width:600}
		save current document in pbFold
		close current document
	end tell