Please work in OS X and OS 9!

Hi,
I am a graphic designer and have been called on to creat a script that opens a pdf from flash. ← ok I am not the best person for this job :slight_smile:

Here is my script :

tell application "Acrobat Reader 5.0"
    open file "MyCD:pdf:step1.pdf"
end tell

I created it using “ScriptEditor” - works great. I put Acrobat Reader 5.0 on the cd with all of the files and it works on OS X machines.
Now when I run it on os9 machines it brings up an error asking where “Acrobat Reader 5.0.app” is?

Here is the real trick - when I rewrite it on OS 9 it works on OS 9 machines but not on OS X.
I am guessing my problem is the “.app” on the end of the name. How do I generically call “Acrobat Reader 5.0” so that it works on both OS versions?

Or can I do some if statement that switches which app gets called on each OS?

Thanks for any help you can give me!
Steven Sprague

This might work on all machines.

tell application "Finder"
	set app_ to application file id "CARO" as text
	open file "MyCD:pdf:step1.pdf" using app_
end tell

If a newer version of Reader is installed on the target machine, it might use that.

– Rob

Hi,

Thank You for the reply! I used the code you posted and it works well on OS X, but it did not work in OS 9.

On 9 I was told:
“Invaled Key Form”

Thanks again for the help!

Ok, let’s try again. If you can make sure that the creator code of the pdf file on the CD is “CARO”, this should open it in Adobe Reader no matter which OS is in use (I hope). :wink:

using terms from application "Finder"
	tell application "Finder"
		open file "path:to:file.pdf"
	end tell
end using terms from

– Rob

Hi,
Well, I have found one culprit. Acrobat 5.1 will not run off of a cd. Now I have to have the installer on the CD and make the end user have it installed. Bummer…
With it installed on the machines I have found this to work:


tell application "Finder" 
    open file "MyCD:pdf:step1.pdf" 
end tell 

I hope that is not a bad way of doing things, but it does seem to work.
How do you find out creator codes?

-steven

MuchoFileInfo is freeware and top cool for looking/changing creator and type of files. Works fine on OSX.

This should do it. Just remember that creator codes are case sensitive.

set cf_ to (choose file with prompt "Choose file whose creator code you wish to know.")
tell application "Finder" to set cc_ to creator type of cf_
display dialog cc_

And this should allow you to change it. This example will change the creator type to that of Adobe Reader.

tell application "Finder" to set creator type of file "path:to:file" to "CARO"

– Rob

LOL, Rob you are nasty, why make useless this fine freeware this guy did? Ha well I’ll keep it in my dock to honor the good work :-).

I like to keep installations of extra software to a minimum. 8)

– The nasty one