Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search In Conversation
#2
Something like this?
I put the rich edit into a dialog for the example.
So run the Dialog "Ghost" first, then run "Ghost 2".


Function Ghost
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages


str controls = "3 5"
str rea3 rea5
rea3=
;Leah: I played a baseball game Today.
;Leah: I also went to a moive.
;Denis: Oh Cool.
;Leah: I played a soccer game too.
;Leah: I have to go to work now.
rea5=
;Leah: I played a baseball game Today.
;Leah: I also went to a moive.
;Denis: Oh Cool.
;Leah: I played a soccer game too.
;Leah: I have to go to work now.
;Leah: Now i am played out.
if(!ShowDialog("Ghost" &Ghost &controls)) ret


;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Ghost"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 RichEdit20A 0x54233044 0x200 18 12 186 45 ""
;4 Static 0x54000000 0x0 92 4 34 8 "Example 1"
;5 RichEdit20A 0x54233044 0x200 18 66 186 46 ""
;6 Static 0x54000000 0x0 92 58 34 8 "Example 2"
;END DIALOG
;DIALOG EDITOR: "" 0x2030001 "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1

Macro: Ghost 2
Code:
Copy      Help
act(win("Ghost" "#32770"))
str a.getwintext(id(3 "Ghost"))
str b=a
str c="played"
int i n
rep
,i=findw(b c i)
,if(i<0) break
,i+c.len
,n+1
if n>=2
,out "2 or more 'played' found, continueing macro"
,mac- "Ghost 3"
else end

Macro: Ghost 3
Code:
Copy      Help
act(win("Ghost" "#32770"))
str a.getwintext(id(5 "Ghost"))
str b=a
str c="played"
int i n
rep
,i=findw(b c i)
,if(i<0) break
,i+c.len
,n+1
if n>3
,out "message"
,end
else
,out "3 or less 'played' found"
,end
Taking on Quick Macros one day at a time


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)