Launching a local file - NEW SOLUTION
Richard Gaskin
ambassador at fourthworld.com
Sat Aug 9 13:22:01 EDT 2003
Ken Ray wrote:
> 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
I called it like this:
on mouseup
LaunchIt "/Volumes/FourthWorld/4W Catalog/webmerge/WebMerge 2.0/WebMerge
Help/WebMerge_Help/WebMergeHelp.html"
end mouseup
And got an error:
Error:usage: cp [-R [-H | -L | -P]] [-f | -i] [-p] src target
cp [-R [-H | -L | -P]] [-f | -i] [-p] src1 ... srcN directory
:/
--
Richard Gaskin
Fourth World Media Corporation
Developer of WebMerge: Publish any database on any Web site
___________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
Tel: 323-225-3717 AIM: FourthWorldInc
More information about the metacard
mailing list