Hi to all,
I've asked this question before and the scripts I've received have only been able to find once.
Does anyone have a button script to use on a field called "supplies" that will:
ask "Find What?"
find it
find it again when I press the Return key
and when it can't find it again by pressing the Return key Answer " it was not found"
Thanks,
Patrick
Find script for a field search
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Find script for a field search
Hi Patrick,
Try this script
Best regards
Jean-Marc
Try this script
Code: Select all
local sString
on debSearch
ask "Find What?"
put it into sString
returnkey
end debSearch
on returnkey
find sString in fld "Supplies"
select empty --prevent the return in field
if the foundChunk = empty then answer " it was not found"
select empty --prevent the return in field
end returnkey
Jean-Marc
https://alternatic.ch
Re: Find script for a field search
Jean-Marc,
Thank you. Very nice script. It works very well but if I keep pressing return after the last find I press it again and nothing happens, then I press it again an it starts at the first find. What's happening on the the find after the last find when nothing appears. I would think when it finds the last occurrence it would either start again or say "it was not found"
Patrick
Thank you. Very nice script. It works very well but if I keep pressing return after the last find I press it again and nothing happens, then I press it again an it starts at the first find. What's happening on the the find after the last find when nothing appears. I would think when it finds the last occurrence it would either start again or say "it was not found"
Patrick
Re: Find script for a field search
Hi Patrick,
Best
Jean-Marc
The answer dialog "it was not found" don't appear ?What's happening on the the find after the last find when nothing appears
Best
Jean-Marc
https://alternatic.ch
Re: Find script for a field search
Hi Jean-Marc,
I was wanting it to search again every time I pressed the return key. I added 2 words and it seems to be just fine!
After - ask "Find What?" I put in "with sString"
on mouseUp
debSearch
end mouseUp
local sString
on debSearch
ask "Find What?" with sString
put it into sString
returnkey
end debSearch
on returnkey
find sString in fld "Supplies"
select empty --prevent the return in field
if the foundChunk = empty then answer " it was not found"
select empty --prevent the return in field
end returnkey
Thanks Again!
I was wanting it to search again every time I pressed the return key. I added 2 words and it seems to be just fine!
After - ask "Find What?" I put in "with sString"
on mouseUp
debSearch
end mouseUp
local sString
on debSearch
ask "Find What?" with sString
put it into sString
returnkey
end debSearch
on returnkey
find sString in fld "Supplies"
select empty --prevent the return in field
if the foundChunk = empty then answer " it was not found"
select empty --prevent the return in field
end returnkey
Thanks Again!