Page 1 of 1

Clickable URL link from a field

Posted: Tue Mar 24, 2009 10:06 pm
by Duncan
Have been experimenting with creating a clickable link from text in a field. Using

Code: Select all

if mouseText () ="clickable" then launch url "http://w....
which works. I also tried using clickText but I did not manage to make that work.

If this is the way to do this I am left with a couple of questions:

The text that you click on does not indicate that it is a clickable link. Is there some way to make it appear so or should it just be Styled -underlined etc?

It seems only a single word can be clicked on. Ideally I would like to click anywhere on "some clickable text" as a link. I did see mention of GroupText (or possible TextGroup) in the docs but did not manage to find any details.

Am I heading in the right direction? Any pointers where to head next will be much appreciated.

Posted: Wed Mar 25, 2009 12:47 am
by Mark
Hi Duncan,

This is not the way to do it. Instead, set the textStyle of the text you want to be clickable to "link". Create a script that checks which text has been clicked on. To give you some idea of how that works:

Code: Select all

on linkClicked theLink
  if theLink contains "(see card 2)" then
    go cd 2
  else if char 1 to 7 of theLink is "http://" then
    launch url theLink
  else if theLink contains "@" then
    revMail theLink
  else
    beep
  end if
end linkClicked
Best,

Mark

Posted: Fri Mar 27, 2009 7:19 pm
by Duncan
Thanks. I thought I was straying away from some obvious solution.