Code: Select all
on findOnCard
put field "search term" into tTextToFind
put the long id of this card into tCardLongId
lock screen
lock messages
find string tTextToFind in field "file contents"
if the long id of this card <> tCardLongId then
go back
unlock screen
answer "end of file contents reached"
end if
end findOnCard
In the list archives I came across solutions that involved looping over all the cards in the stack and setting the dontSearch to true, then setting the dontSearch of the current card to false. Whilst people on the list seemed to have no problem with this, I found it only worked sporadically and difficult to debug (could have been my fault - maybe I was missing something).
Looking through my old "Hypertalk 2.2" book, it looks like one ought to be able to do "find ... on marked cards", but I couldn't get that to work in Rev 2.7.4.
Anyway, I thought I'd just post this info here, in case someone in the future is searching for a simple way to restrict a Find to just one card.
Bernard