This content has been marked as final. Show 2 replies
This will tell you what version of Acrobat is installed:
So you can see that I am using 7.0. Actually, the baFindApp("PDF")
thing gets the location/filename of the program associated with PDF. In
my case it is Acrobat:
-- "D:\Program Files\Adobe\Acrobat 7.0\Acrobat\Acrobat.exe"
If you really need to make sure that it is the Acrobat Reader, then you
need to run a check against that to make sure it is the right program
(it would be acroread.exe for someone who does not have the full version
Then, you can use baFileVersion to get the version number. Since all
you care about is the 1st 2 pieces, you can parse the version string and
compare it to the version number you wish. <Warning- untested, just
typed in off the top of my head Lingo>
if condensedVersion<7.07 then
--tell the user they need a newer version
--do your script
In my case, my computer would fail this test since I have 7.0 which is
less than 7.07. You can simplify it significantly if you just want to
check if it is less than 7.
I contact Buddy API people in Australia via email -- and have made what I think are their suggested changes in the following script.
However, it seems like what I need is a hybridization of what you recommended in your response, and what they've sent me.
However, since I have no background in scripting -- literally, I cut and pasted everything I had originally from a very helpful website -- the terminology and structure mean nothing to me, really.
Can what I have below be adjusted to do what I need?
on new (me)
pDefaultDocDir = "Files"
on OpenFile me , p_FileType , p_Dir , p_FileName
set FileToOpen = the moviePath & pDefaultDocDir & "\" & p_Dir & "\" & p_FileName
-- Open the FileType
if (p_FileType = "PDF") then
me.StartAcrobat ( FileToOpen )
--Acrobat File opening
on StartAcrobat me, p_PDFFile
if ( baFileExists( p_PDFFile ) = 1 ) then -- check if file exists
set AcroRead32Exe = baReadRegString( "Software\Microsoft\Windows\CurrentVersion\App Paths\AcroRd32.exe", "", "", "HKEY_LOCAL_MACHINE" ) -- see if acrobat is installed
if AcroRead32Exe <> "" then -- if they have acrobat and the file exists
set the itemDelimiter = "."
if integer( item 1 of baFileVersion( AcroRead32Exe ) ) >= 7 then -- version 7 or later is installed
baOpenFile( p_PDFFile , "Maximised" ) -- open the file
sprite(27).callFrame(3) -- earlier version installed, do whatever is appropriate
Many thanks --