PDF and PPT

Ken Ray kray at sonsothunder.com
Sun Jan 15 14:45:17 EST 2006


On 1/15/06 11:58 AM, "Rick Rice" <rick-rice at shaw.ca> wrote:

> First, thanks Tom and Alex for your suggestions.
> However, Ken asked the question the way I should have.
> What I want to do is launch PowerPoint and/or Acrobat reader from
> within Rev and pass it the document for display outside of Rev.
> I did, after posting the first time, find the "launch   with" command.
> Works great as long as I know the exact path to both the file and the
> app. My problem is how do I do this when I have created a standalone
> and the stack is being used by a student and I have no idea where their
> app is actually located? I would be able to locate the file, as it will
> be distributed in the directory with the stack.
> Thanks Ken. An answer is always more likely if the question is
> correctly asked.

No prob, Rick... Try this:

on LaunchDoc pPath
  if the platform is "Win32" then  -- Windows 98SE or higher*
    put shortFilePath(pPath) into pPath
    put item 1 to (the number of items of pPath - 1) of pPath & \
      "/" into tDir
    put item -1 of pPath into tItem
    put char 1 to 2 of tDir into tDrive
    set the hideConsoleWindows to true
    get shell(tDrive && "& cd" && tDir && " & start" && tItem)
  else    -- Mac
    replace "/" with ":" in pPath
    if char 1 of pPath = ":" then delete char 1 of pPath
    put "tell application" && q("Finder") & cr & \
      "open file" && q(pPath) & cr & "end tell" into tAS
    do tAS as "AppleScript"
  end if
end LaunchDoc

This should work... (hope there aren't any typos)...


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com

* If you need it to work in earlier versions of Win98 or Win95, let me know.




More information about the use-livecode mailing list