Opening Acrobat Files

Ian Summerfield iansummerfield at btconnect.com
Tue Feb 19 11:05:01 EST 2002


On 19/2/02 1:16 pm, "Peter Reid" <preid at reidit.co.uk> scribed:

> 2) how do I get the path to Acrobat Reader on the Mac into a Rev
> variable so I can use the "launch" command? (more generally, how do I
> get results back from an AppleScript script?)
> 
> I have been using the Externals Collection but I'm hitting a brick
> wall with this, especially since it doesn't work under Mac OS X!  I'm
> trying to find another way that avoids the need to use the Externals.

To get the path, I don't know,  more generally I'd like to know too how to
get the path of a running application.  But, assuming you solve that
problem, "the result" will contain whatever you "return" in AppleScript.

Firstly check you have AppleScript available:

 if "AppleScript" is not in the alternateLanguages then
    beep
    answer "Applescript needs to be installed for this program to function."
    quit
  end if


on getprocesses
  do the applescript1 of this stack as AppleScript
  put the result into processlist
-- now check to see if it contains whatever you want
end getprocesses


The applescript1 should be a property of the stack and it's contents will
be:

tell application "Finder"
return name of every process
end tell


A tip on launching,  KILL the process FIRST, it won't do any harm even if
it's not running.

Put "/volume/folder/appname" into thePath
-- check your processes next using the applescript
-- to see it isn't already running
KILL quit process thePath -- clears the openProcesses,
-- otherwise RR could return
-- "process already running" on the launch because it didn't know something
-- outside, like a user, had quit it
launch thePath
-- check the result for "error -nn"
 

If you don't Kill quit first then don't be surprised if the launch command
doesn't work every time.

Trust me, this works under OS X and OS 9.







More information about the Use-livecode mailing list