Msg Box usage from scripts
JonathanC at ag.nsw.gov.au
JonathanC at ag.nsw.gov.au
Mon Jul 26 06:57:20 EDT 2004
Hi Jim,
Here's a little script I use to partially emulate HyperCard's command-F
"Find" (except that I use command-E):
on commandKeyDown whichKey
if whichKey <> "E" then pass commandKeyDown
go stack "Message Box"
put "Find" && quote & quote into fld "Message Field" of stack "Message
Box"
select char 7 to 6 of fld "Message Field" of stack "Message Box"
end commandKeyDown
The important bit for you is "put ... into fld "Message Field" of stack
"Message Box".
Of course, my handler doesn't remember the last search string or let you
do a "search whole" (in HC, it was command-shift-F, I think), but it
wouldn't be hard to add those features - I just haven't gotten around to
it yet :-).
Hope that helps.
Jonathan Cooper
Manager of Information / Website
Art Gallery of New South Wales
Sydney, Australia
http://www.artgallery.nsw.gov.au
use-revolution-bounces at lists.runrev.com wrote on 26/07/2004 03:38:46 AM:
> Greetings,
>
> Revolution 2.2.1 on MacOSX
> How do I set the command line in the message box?
> None of the documentation or examples I have read covers this.
> (I have read Receipe for Find field). I am an old Hypercard programmer.
>
> Desired behavior
> 1) The goal is to allow control-click of a word in a unlocked field
> to be put into the message box as 'find "textStr', thus the user can
> simply hit the enterkey to continue to find occurrences.
>
> Not what I want to accomplish...
> 2) using 'put textStr into to msg' or 'put textStr' adds the word
> "textStr" to the result pane of msg.
> 3) using 'put ("find " & quote & "textStr" & quote)' also adds to
> the result pane, thus the user cannot simply hit the enter key to
> repeat the find operation.
>
> Eg...
> on mouseDown
> if the controlkey is down then
> put the clickText into temp
> put ("find " & quote & temp & quote) --to set the msg
> find the clickText -- do the first find here
> end if
> end mouseDown
>
> Is there a message box property to set?
> Is there a message to send up the heirarchy?
>
> Work around is to just have the user continually click on the found
> word with the control key down. This could get to be more like a
> video game, however.
>
> Thanks for your help
>
> Jim Ault
> Las Vegas
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list