Launching a local file - NEW SOLUTION

Ken Ray kray at sonsothunder.com
Sat Aug 9 12:12:43 EDT 2003


Hugh,

That works for internet addresses and local files that don't have a type
and creator code associated with them. If you *do* have a type/creator
code, you need to strip it before you can launch it.

But you're right... "send to ..." is a lot easier than crafting an
AppleScript for that purpose. So here's my previous solution with "sent
to" used instead, along with a method to just strip the original file's
type/creator code and effectively "leave it in place" and a little error
checking:

on launchit pPath
  StripTC pPath
  send "file:///" & pPath to program "Finder" with "GURLGURL"
end launchIt

on StripTC pPath
  put pPath into tDestPath
  set the itemDel to "/"
  put last item of pPath into tOrigName
  put "temp.html" into last item of tDestPath
  get shell("cp" && pPath && tDestPath)
  if it <> "" then
    answer "Error:" & it
    exit to top
  end if
  put tOrigName into last item of pPath
  get shell("mv" && tDestPath && pPath)
  if it <> "" then
    answer "Error:" & it
    exit to top
  end if
end StripTC


Have fun!

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

-----Original Message-----
From: metacard-admin at lists.runrev.com
[mailto:metacard-admin at lists.runrev.com] On Behalf Of
FlexibleLearning at aol.com
Sent: Saturday, August 09, 2003 7:41 AM
To: metacard at lists.runrev.com
Subject: Re: Launching a local file


I though this was simply

    send tAddress to program "Finder" with "GURLGURL"

where tAddress resolves to either a local or internet url. Or did I miss
the original point once again?    :)

/H 





More information about the metacard mailing list