How to get AS launching correct version application?

I have two versions of Acrobat Pro residing on my harddisk, Adobe Acrobat 7.0 Professional and Adobe Acrobat 8.0 Professional.

I want my script to launch the Acrobat 8.0. I use a simple script as follow to figure out the problem:

tell application "Adobe Acrobat 8.0 Professional"
	activate
	-- perform my task
end tell

Depending on the circumstances while I execute this script, it may launch ver 7 instead of ver 8. The scenario is as follows:

A. Both of the followings work fine, it will launch ver 8

  1. Execute script while no Acrobats are active
  2. Execute script while Acrobat 8 is active

B. This will launch the wrong ver 7
3. Execute script while Acrobat 7 is active

C. This depends…
4. Execute script while both Acrobat 7 and Acrobat 8 are active

I search through the board and found few approach to overcome this issue, but none of them works for me:

  1. Launch the application using a physical path of the application;
  2. Launch the application “using using terms from”;
  3. Launch the application using file id or bundle identifier (unfortunately, both versions share the same file id or bundle identifier)

Hope someone can help me to overcome this annoying issue. Thanks!

Try these…

do shell script "open -a Adobe\\ Acrobat\\ 8.0\\ Professional.app"
tell application "Adobe Acrobat 8.0 Professional"
   activate
   -- perform my task
end tell
do shell script "open -a Adobe\\ Acrobat\\ 7.0\\ Professional.app"
tell application "Adobe Acrobat 7.0 Professional"
   activate
   -- perform my task
end tell

Regards,

Tom

Browser: Safari 530.19
Operating System: Mac OS X (10.5)

Thank you for your reply, Tom Ostro.

I tried your suggestion:

do shell script "open -a Adobe\\ Acrobat\\ 8.0\\ Professional.app"
tell application "Adobe Acrobat 8.0 Professional"
	activate
	-- perform my task
end tell

It does launch ver 8, but it still using ver 7 to perform the task as long as ver 7 has already open.

Could it be because ver 8 has not complete its launching, thus ver 7 take over its job? If so, how am I going to tackle it?

Thanks!

Just try again to let ver 8 to have enough time to launch, yet no luck! I think it will just get the firstly open application to perform the task…

Hi, Let’s try the full path to Adobe Acrobat 8.0 Professional with a delay and remove: activate.
I’m guessing that the name of the folder is: Adobe Acrobat 8.0 Professional – and it’s in your Applications folder.

do shell script "open -a /Applications/Adobe\\ Acrobat\\ 8.0\\ Professional/Adobe\\ Acrobat\\ 8.0\\ Professional.app"
delay 4 -- Increase or decrease as needed
tell application "Adobe Acrobat 8.0 Professional"

   -- perform my task

end tell

Tom

Browser: Safari 530.19
Operating System: Mac OS X (10.5)

Thank you for your prompt reply, Tom Ostro.

I think the problem doesn’t fall on the do shell script line, because it does launch the correct version as requested.

Just try again to let ver 8 to have enough time to launch (I even try delay 10), yet no luck!

I think it will just get the firstly open application to perform the task… That means, if ver 7 is open first followed by ver 8, no matter how, it will let ver 7 to perform the task.

Second thought, if this couldn’t be fixed for the time being, can I have a workaround method by asking the user to quit other versions of Acrobat except ver 8?

But then, how am I going to detect is there any other versions of Acrobat which is(are) currently open?

Thanks!

If this doesn’t help, someone else may have the solution.

tell application "System Events" to set ffopen to exists process "Adobe Acrobat 7.0 Professional"
if ffopen then
	
	tell me to display dialog "Currently Adobe Acrobat 7.0 Professional is active.
Want to quit version 7.0 and launch version 8.0?" buttons {"Cancel", "Yes"} default button 2
	if the button returned of the result is "Yes" then
		quit application "Adobe Acrobat 7.0 Professional"
		delay 0.4
		do shell script "open -a Adobe\\ Acrobat\\ 8.0\\ Professional.app"
		tell application "Adobe Acrobat 8.0 Professional"
			activate
			-- perform my task
		end tell
	end if
	
else
	-- I don't know what  'else'  you want to do here.
	(*	
	do shell script "open -a Adobe\\ Acrobat\\ 7.0\\ Professional.app"
	tell application "Adobe Acrobat 7.0 Professional"
		activate
		-- perform my task
	end tell
*)
end if

Tom

Browser: Safari 530.19
Operating System: Mac OS X (10.5)

My guess (I do not even have one version of Acrobat here) is that although they have different names on disk, both versions share the same bundle ID. I thought this was what Leopard’s application “/posix/path/to/an.app” specifier was for (no Leopard on my machine, either).

tell app "/Applications/Adobe Acrobat 8.0 Professional/Adobe Acrobat 8.0 Professional.app" .

Sorry for the late feedback because I didn’t have access to the station that consists few versions of Acrobat.

Thank you, Tom Ostro. Your script for checking Acrobat 7 existence does work provided the name of the application tally with the one spelt in the script. But you know, some users like to change the application name to look neater…

Anyway, thanks for your advice!