Using linkText

Pete pete at mollysrevenge.com
Fri Jul 8 12:12:11 EDT 2011


Thanks Peter, that will be useful.
Pete
Molly's Revenge <http://www.mollysrevenge.com>





>
> Here's what I have in one of my fields, where I am creating links from time
> to time:
>
> on mouseup
>   -- select the text you want to turn into a link
>   -- then control-click the selectedText
>   -- mouseup is sent when control-clicking in an unlocked field
>   if the environment <> "development" then pass mouseup
>   if $user <> "pmbrig" then exit mouseup
>   -- prevents other users from modifying links
>   if the controlkey is down then
>      put the clickchunk into cc
>      put the clicktext into ctxt
>      put the linktext of cc into linkT
>      -- in case you are modifying an existing link
>      ask "Linktext for '" & ctxt & "'?" with linkT as sheet
>      put result() into r
>      put it into linkT
>      if r = empty then
>         if linkT = empty then
>            -- to remove link & set the text back to normal style
>            set the forecolor of cc to empty
>            set the textstyle of cc to empty
>            set the linktext of cc to empty
>         else
>            set the forecolor of cc to blue
>            set the textstyle of cc to link
>            set the linktext of cc to linkT
>         end if
>      end if
>   else
>      pass mouseup
>   end if
> end mouseup
>
> -- Peter
>
> Peter M. Brigham
> pmbrig at gmail.com
> http://home.comcast.net/~pmbrig
>
>



More information about the use-livecode mailing list