Photoshop CS2 Web Gallery Script

I am working on a script to create Photoshop web galleries from a set of folders. I am having problems setting the options for the photo gallery in Photoshop. If I look at the scripting guide for Photoshop and follow it, the script snippet they give doesn’t even work:


tell application "Adobe Photoshop CS2"
create photo gallery with options: {from file:"Macintosh HD:WebImages",¬
 to file "Macintosh HD:NewWebImages", ¬
class:gallery banner options {sitename:"My Site"}¬
class:gallery images options {include file name:false}}
end tell

That is a snippet of code that is close to what the Adobe Photoshop scripting guide shows.

My code is this:

		tell application "Adobe Photoshop CS2"
			set myOptions to {{class:gallery options, layout style:"Simple"}, ¬
				{class:gallery banner options, site name:"Woody"}, ¬
				{class:gallery thumbnail options, row count:5, dimension:100}, ¬
				{class:gallery images options, include file name:false}}
			create photo gallery from folder folderPath to folder destPath with options myOptions
		end tell

The error I receive when trying to run this is:

Adobe Photoshop CS2 got an error: Illegal argument - argument 3

  • Object expected

I need to be able to pass multiple class options for the photo gallery. Does anyone have any ideas?

Thanks.

Steve

Not sure if this has changed in CS2, but this works in CS:



tell application "Adobe Photoshop CS"
	create photo gallery from folder sourceFolder to folder destFolder with options {{banner options:{contact info:"Woody"}, layout style:"Simple", thumbnail options:{row count:5, dimension:100}}
end tell

Hope it’s clear.

-N

Thanks Nedloh. Tried that, but it didn’t work. Here is the snippet that I tried:


set sourceFolder to "Macintosh HD:2005_06_06"
set destFolder to "Macintosh HD:2005_06_06_web"
tell application "Adobe Photoshop CS2"
	create photo gallery from folder sourceFolder to folder destFolder with options ¬
		{{banner options:{contact info:"woody"}}, {thumbnail options:{row count:5, dimension:100}}}
end tell

I receive this error when trying:

Adobe Photoshop CS2 got an error: Illegal argument - argument 3

  • Object expected

Any other ideas?

I’m going to try it on a machine with CS loaded and not CS2 to see if it works there.

Steve

with options ¬
{banner options:{contact info:“Woody”}, thumbnail options:{row count:5, dimension:100}}

Tried this:


set sourceFolder to "Macintosh HD:2005_06_06"
set destFolder to "Macintosh HD:2005_06_06_web"
tell application "Adobe Photoshop CS2"
	create photo gallery from folder sourceFolder to folder destFolder with options¬
	 {banner options:{contact info:"Woody"}, thumbnail options:{row count:5, dimension:100}}
end tell

Got this:

Adobe Photoshop CS2 got an error: Illegal argument - argument 1

Argghh! If I had hair, i’d pull it out. :smiley:

Steve

I just tried it on a machine with CS1 loaded, and that snippet worked. So, I’ll just develop it using CS1.

Thanks again for the help!

Steve

Steve,

Couldn’t resist, so I downloaded the Demo of CS2. This (your snippet) works fine in CS2 on 10.3.6

set sourceFolder to choose folder with prompt "Source"
set destFolder to choose folder with prompt "Dest"

tell application "Adobe Photoshop CS2"
	create photo gallery from folder sourceFolder to folder destFolder with options ¬
		{banner options:{contact info:"Woody"}, thumbnail options:{row count:5, dimension:100}}
end tell

-N