Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search In Conversation
#1
Is it Possible to search sentances in a conversation and see how many times the word "played" is used the conversation? *Convo box is a RichEdit*

Example1: (Sentances In Conversation)
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.
-In example one when Macro is running i want it to check and see how many times the word "played" is used in the conversation. If it is only used Twice or Less then macro will continue to run.

Example2: (Sentances In Conversation)
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.
-But if the word (played) is found more then 3 times then the macro will out a message and End. Is that possible to make? I know it might sound a little crazy.
I hope that makes sense Gintras.
Thanks,
Best Regards.
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)