If MsgBox("The Queue is been monitored for new call, an Alarm will be triggered when [NEW] or [ST] call are created within the Queue!", vbOKCancel) = vbCancel Then Exit Submoktarious wrote:How can I make the OK go on with the rest of the script and the cancel to abort it?
Help with repeating command on IBM PCOMM
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Re: Help with repeating command on IBM PCOMM
Nathan
There's no place like home.....
There's no place like home.....
-
- StarLounger
- Posts: 61
- Joined: 08 Oct 2011, 21:25
Re: Help with repeating command on IBM PCOMM
Awesome this one work!
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Re: Help with repeating command on IBM PCOMM
Nearly, try:moktarious wrote:U mean
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" or autECLSession.autECLPS.GetText(5, 26, 3) <> "ST"
hehe ;)
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" or autECLSession.autECLPS.GetText(5, 26, 2) <> "ST"
or maybe:
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" or <> "ST"
Nathan
There's no place like home.....
There's no place like home.....
-
- StarLounger
- Posts: 61
- Joined: 08 Oct 2011, 21:25
Re: Help with repeating command on IBM PCOMM
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" or autECLSession.autECLPS.GetText(5, 26, 2) <> "ST" ------- Nothing happend
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" or <> "ST -------- syntax error
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" or <> "ST -------- syntax error
-
- Administrator
- Posts: 78545
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Help with repeating command on IBM PCOMM
Nathan
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" or <> "ST"
will not do what you want, you MUST repeat the variable.
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" or <> "ST"
will not do what you want, you MUST repeat the variable.
Best wishes,
Hans
Hans
-
- StarLounger
- Posts: 61
- Joined: 08 Oct 2011, 21:25
Re: Help with repeating command on IBM PCOMM
Nathan
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" or <> "ST"
will not do what you want, you MUST repeat the variable.
SYNTAX Error HansV, and btw Thanks for your help also
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" or <> "ST"
will not do what you want, you MUST repeat the variable.
SYNTAX Error HansV, and btw Thanks for your help also
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Re: Help with repeating command on IBM PCOMM
I was clutching at straws here, I did not think it would work....moktarious wrote: Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" or <> "ST -------- syntax error
I don't understand what you mean by nothing happens? It seems an acceptable syntax to me. I cannot see any other approach?moktarious wrote:Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" or autECLSession.autECLPS.GetText(5, 26, 2) <> "ST" ------- Nothing happend
Nathan
There's no place like home.....
There's no place like home.....
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Re: Help with repeating command on IBM PCOMM
Can you post your entire code preferably between code tags?
Nathan
There's no place like home.....
There's no place like home.....
-
- StarLounger
- Posts: 61
- Joined: 08 Oct 2011, 21:25
Re: Help with repeating command on IBM PCOMM
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" or autECLSession.autECLPS.GetText(5, 26, 2) <> "ST" (the loop keep on running, and there is a "NEW" call in the queue)
Code: Select all
'REM This line calls the macro subroutine
subSub1_
Sub subSub1_()
If MsgBox("An Alarm will be triggered when [NEW] or [ST] call are created within the Queue!", vbOKCancel, " The Queue will be monitored for new call") = vbCancel Then Exit Sub
'Once logged in and at the local queue, with all service call listed.....
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW"
autECLSession.autECLOIA.WaitForAppAvailable
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "ci" 'Screen coordinates 22/28 (Need the syntax)
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[enter]"
autECLSession.autECLPS.Wait 10000 'milliseconds - adjust as required
Loop
MsgBox "New Call Found", vbExclamation, " ***WARNING***"
End Sub
Last edited by moktarious on 09 Oct 2011, 19:14, edited 2 times in total.
-
- Administrator
- Posts: 12615
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Help with repeating command on IBM PCOMM
Since there are only two characters in "ST", I think this should have beenmoktarious wrote:U mean
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" or autECLSession.autECLPS.GetText(5, 26, 3) <> "ST"
hehe ;)
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" or autECLSession.autECLPS.GetText(5, 26, 2) <> "ST"
StuartR
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Re: Help with repeating command on IBM PCOMM
We have been there Stuart! No idea why that won't work, I'm stumped!StuartR wrote:Since there are only two characters in "ST", I think this should have beenmoktarious wrote:U mean
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" or autECLSession.autECLPS.GetText(5, 26, 3) <> "ST"
hehe ;)
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" or autECLSession.autECLPS.GetText(5, 26, 2) <> "ST"
Nathan
There's no place like home.....
There's no place like home.....
-
- StarLounger
- Posts: 61
- Joined: 08 Oct 2011, 21:25
Re: Help with repeating command on IBM PCOMM
The loop keep on running, and there is a "NEW" call in the queue, that's what happen.
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Re: Help with repeating command on IBM PCOMM
More clutching at straws, try changing the "or" to "and"
Nathan
There's no place like home.....
There's no place like home.....
-
- StarLounger
- Posts: 61
- Joined: 08 Oct 2011, 21:25
Re: Help with repeating command on IBM PCOMM
Vegas you rock, that made it.
Now before the whole script start I need the cursor to be at position 22/008.
Please and a million thanks in advance
Now before the whole script start I need the cursor to be at position 22/008.
Please and a million thanks in advance
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Re: Help with repeating command on IBM PCOMM
Code: Select all
'REM This line calls the macro subroutine
subSub1_
Sub subSub1_()
If MsgBox("An Alarm will be triggered when [NEW] or [ST] call are created within the Queue!", vbOKCancel, _
" The Queue will be monitored for new call") = vbCancel Then Exit Sub
'Once logged in and at the local queue, with all service call listed.....
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" And _
autECLSession.autECLPS.GetText(5, 26, 2) <> "ST"
autECLSession.autECLOIA.WaitForAppAvailable
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys("ci", 22, 28)
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[enter]"
autECLSession.autECLPS.Wait 10000 '10 seconds - adjust as required
Loop
MsgBox "New Call Found", vbExclamation, " ***WARNING***"
End Sub
I assume then that when "ci" & [enter] is input, the cursor automatically returns to that position? (else I can't see how this would be working)
Does the above work, else I'll have to find that bit out tomorrow and get back to you, I'm not certain of the syntax.
Nathan
There's no place like home.....
There's no place like home.....
-
- StarLounger
- Posts: 61
- Joined: 08 Oct 2011, 21:25
Re: Help with repeating command on IBM PCOMM
I am the one putting the cursor at 22/008 before starting the macro
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Re: Help with repeating command on IBM PCOMM
Yes, but within the loop, "ci" & enter is continuously entered, so the cursor must default back to that position?moktarious wrote:I am the one putting the cursor at 22/008 before starting the macro
Does
autECLSession.autECLPS.SendKeys("ci", 22, 28)
or
autECLSession.autECLPS.SendKeys ("ci", 22, 28)
work?
Or the equivalent with 22/08
Nathan
There's no place like home.....
There's no place like home.....
-
- StarLounger
- Posts: 61
- Joined: 08 Oct 2011, 21:25
Re: Help with repeating command on IBM PCOMM
Well after u press enter, the cursor get back by itself to 22/008
You understand sir?
So let's say my cursor is somewhere in the screen, how I make the script place the cursor to 22/008 before running the macro?
You understand sir?
So let's say my cursor is somewhere in the screen, how I make the script place the cursor to 22/008 before running the macro?
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Re: Help with repeating command on IBM PCOMM
Or:
autECLSession.autECLPS.SendKeys "ci", 22, 28
It does not matter where the cursor is, the cursor is not required. Does the above work?
autECLSession.autECLPS.SendKeys "ci", 22, 28
It does not matter where the cursor is, the cursor is not required. Does the above work?
Nathan
There's no place like home.....
There's no place like home.....
-
- StarLounger
- Posts: 61
- Joined: 08 Oct 2011, 21:25
Re: Help with repeating command on IBM PCOMM
Thanks yes now this work, so now let figure out how to make the MsgBox "New Call Found", vbExclamation, " ***WARNING***" loop till the ok is pressed (it will keep beeping, like an alert or alarm u follow me sir?
Code: Select all
'REM This line calls the macro subroutine
subSub1_
Sub subSub1_()
If MsgBox("An Alarm will be triggered when [NEW] or [ST] call are created within the Queue!", vbOKCancel, _
" The Queue will be monitored for new call") = vbCancel Then Exit Sub
'Once logged in and at the local queue, with all service call listed.....
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" And _
autECLSession.autECLPS.GetText(5, 26, 2) <> "ST" And autECLSession.autECLPS.GetText(6, 26, 3) <> "NEW" And _
autECLSession.autECLPS.GetText(6, 26, 2) <> "ST"
autECLSession.autECLOIA.WaitForAppAvailable
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "ci", 22, 008
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[enter]"
autECLSession.autECLPS.Wait 10000 '10 seconds - adjust as required
Loop
MsgBox "New Call Found", vbExclamation, " ***WARNING***"
End Sub