Tell application ...CS3 or CS4

Hi, I’m creating a script to work with either “Adobe Photoshop CS3” or “Adobe Photoshop CS4”, whichever the user has installed, to make the script universal.

How to have something like tell application X or Y activate?

Thanks a lot

You might try something like this

try
	set myApp to application "Adobe Photoshop CS4"
	activate myApp
on error
	try
		set myApp to application "Adobe Photoshop CS3"
		activate myApp
	on error
		set myApp to false
	end try
end try

Hmmm it’s giving “File Photoshop wasn’t found”

When I ran it:
The first time, it asked me to find both of the Adobe files (I have neither) and then finished running, setting myApp to false.

Thereafter, it didn’t inquire about the paths.

This matches the performance when I tested it with applications that I do have.

Is the code different if the person has CS3 or CS4? In my office, we are slowly making the transition to CS$, but so far everything just works for my scripts to just “telling” CS3. The script will use whichever one is open, and if neither is open, I believe it will default to CS4 (even though the script tells CS3). Most all of the machines for the time being have both installed. I did have one machine that every time I give her a new version, it launches CS3 the first time , but after that it works the same as the rest.

At one point in the similar transition between CS2 & CS3, I needed to have code work differently if they had CS3, so I checked for a certain file on their hard rive that only existed is CS3 was installed, similar to mikerickson’s code - I can’t remember if I used try/on error or if exists/then/else, but it worked for me at the time. I think I tested for a file in the library that CS4 installed, so it wasn’t tied to the application folder, or the Indesign folder being moved/renamed etc.

I guess these both assume that if the machine has CS4, it also has CS3 still installed, which may not be the case in your situation though…