QT: How do I convert a folderpath to a clickable link?

Ken Ray kray at sonsothunder.com
Tue Apr 15 02:24:12 EDT 2008


> I call with "answer folder" and "longfilepath" the path to a netwerkfolder.
> Now I want to convert  it into a clickable link.
> Any idea's on this one?

Well, assuming your intention is to open a file on a network server after
having gotten the path using the method you describe, you can do it this
way:

-- assumes you want the linked text to say "Open Network File"
-- assumes you have the path in a variable called "tPath"

put "<a href=" & quote & tPath & quote & \
    ">Open Network File</a>" into tLink
set the htmlText of field "Show Link" to tLink

-- script of field "Show Link", with lockText=true
on linkClicked pURL
  launch document pURL
end linkClicked

Haven't tested it, but should work (at least in principle ;-).

On the other hand, if your intention was to try and open a *folder* on the
network server, or something other than launching a file, this'll have to be
tweaked...

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





More information about the use-livecode mailing list