linking text

Sivakatirswami katir at hindu.org
Tue Dec 27 03:03:23 EST 2005


Here is a little script I have been using "forever" (10 years or  
more?) to link a todo list field to another substack.

Button "Make Link"

on mouseup
  makelink
end mouseup

# be sure to set the "traversalOn" of this button to "false" this  
will allow you to select text in a field, and then clicking the  
button does not wipe out  your selection.

on makeLink
   if the selection is empty then
     answer "You need to select something." with "OK"
     exit makeLink
   else
     put the selection into jai
     set the textstyle of the selection to link
     open stack "Linked Entries"
     if exists (card jai)  then
     exit makeLink
     else
    new card
     put jai into fld "Subject"
     set the name of this card to fld "subject"
     send upDateIndex to stack "linked Entries"
# updates an index card with hyper links  to all card in the whole stack
     end if
   end if
end makeLink

# then in the "toDo" list field you have these things:

on mouseDown
   if controlkey()="Down" then
   set the locktext of the target to true
   set the traversalOn of the target to false
     choose browse tool
   end if
end mouseDown

on mouseup
   if optionkey()="Down" then
     set the locktext of the target to false
     set the traversalOn of the target to true
   else
     pass mouseup
   end if
end mouseup
on linkClicked tSubject
   findLinkedItems tSubject
   put  tSubject into gLastLink
end linkClicked

# and more in the stack script:

on findLinkedItems tSubject
   open stack "Linked Entries"
go to cd tSubject
   if the result is not empty then
     answer "No entries for this one. Make a new one? " with "No" or  
"Yes"
     if it = "no" then
       close wd "linked Entries"
       set the locktext of the target to false
       exit findLinkedItems
     else
       open stack "Linked Entries"
       new card
       put tSubject into fld "Subject"
        set the name of this card to fld "subject"
     end if
   end if

end findLinkedItems

then your substack has cards with

fld "subject"
fld "notes"

And those cards have the same MakeLink button and  the  fld "notes"  
has the same script as the main stack todo list.

Now you have global hyperlinking from a toDo list  and  from any  
specific toDo card entry to any other toDo card entry.

I've been using this "core" for my PIM for probably 15 years...  
(since Hypercard, through Supercard and now in Revolution)

with an number of other bells and whistles (global find, calendar,  
reminder system etc) I have a PIM that tops anything else that has  
ever come down the  pike... iData and iOrganize  etc. all those  
things just never quite "do it" for  me... they are all just too  
"demanding" in terms of time they take just to stay organized. I  
suspect other xTalk sages have even more advanced PIM's...

by the makeLink is are the center...





On Dec 26, 2005, at 6:33 AM, Preston Shea wrote:

> How does one link word 6 and word 7 of field myField into a chunk  
> of linked text (responds to mouse as single item)?
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list