Sign in to follow this  
Followers 0
Skorn

WinTitleMatchMode Not working right

9 posts in this topic

#1 ·  Posted (edited)

So I created a script at work so I can set up backups for outlook express. When you open outlook it can have a title of either "Inbox - Outlook Express..." or "Outlook Express..." it depends on your settings, so obviously I need substring matching here and hence I used wintitlematchmode 2, but sometimes it just doesn't work! I don't understand, am I doing this right?

Thanks

Opt("WinTitleMatchMode", 2)
Run ("C:\Program Files\Outlook Express\MSIMN.EXE")
Sleep ( 300 )
WinWaitActive("Outlook")
Edited by Skorn

Share this post


Link to post
Share on other sites



what is the problem

what are you trying to do

all work for me

sorry for my english :whistle:

Share this post


Link to post
Share on other sites

what is the problem

what are you trying to do

all work for me

sorry for my english :whistle:

<{POST_SNAPBACK}>

Well the problem was that when it opens the program it does not continue processing the script even though the word "Outlook" is in the title. I am doing this on different platforms, 98/2k/xp, not sure if it makes a difference.

Share this post


Link to post
Share on other sites

So I created a script at work so I can set up backups for outlook express. When you open outlook it can have a title of either "Inbox - Outlook Express..." or "Outlook Express..." it depends on your settings, so obviously I need substring matching here and hence I used wintitlematchmode 2, but sometimes it just doesn't work! I don't understand, am I doing this right?

Thanks

Opt("WinTitleMatchMode", 2)
Run ("C:\Program Files\Outlook Express\MSIMN.EXE")
Sleep ( 300 )
WinWaitActive("Outlook")

<{POST_SNAPBACK}>

not sure what in your code could be causing this to fail without seeing any sample code, but lots of ways you could go with this one...

1) OR .... use the OR in your check for the window:

if Winactive("Inbox - Outlook Express","") or Winactive("Outlook Express","") Then
;... your code here

or you could do your own substring search:

Opt("WinTextMatchMode",4)
$ActName = WinGetTitle("active","")
if StringInStr($ActName,"Outlook Express") Then
;... your code here

or if you really want to be fancy you could go into the registry, find the settings that affect the title (may take 2 - 3 minutes), record their values, set them how you want them, run your script with a guaranteed title, then replace the values you changed...

or there is always the option of posting your code here and having someone figure out why it's not working...


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Opt("WinTitleMatchMode", 2)

Run ("C:\Program Files\Outlook Express\MSIMN.EXE")

Sleep ( 300 )

While 1

WinWaitActive("Outlook")

MsgBox(262144,'','I see that you are active now')

WinSetState("Outlook", "", @SW_MINIMIZE)

Sleep ( 500 )

WEnd

Share this post


Link to post
Share on other sites

Opt("WinTitleMatchMode", 2)

Run ("C:\Program Files\Outlook Express\MSIMN.EXE")

Sleep ( 300 )

While 1

WinWaitActive("Outlook")

MsgBox(262144,'','I see that you are active now')

WinSetState("Outlook", "", @SW_MINIMIZE)

Sleep ( 500 )

WEnd

<{POST_SNAPBACK}>

and you never see your msgbox?

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

and you never see your msgbox?

<{POST_SNAPBACK}>

every time when outlook is active or front most on screen

I see my msgbox :whistle:

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

every time when outlook is active or front most on screen

I see my msgbox  :whistle:

<{POST_SNAPBACK}>

isn't that what your code is supposed to do?

Opt("WinTitleMatchMode", 2)  ; allows substring title search
Run ("C:\Program Files\Outlook Express\MSIMN.EXE");executes OE
Sleep ( 300 );waits for it (don't really need this line though)

While 1
WinWaitActive("Outlook");waits until it is the active window
MsgBox(262144,'','I see that you are active now');tells you that it is.
WinSetState("Outlook", "", @SW_MINIMIZE); minimizes window
Sleep ( 500 )sleeps...
WEnd

***edit*** i always forget to close my code tags...

Edited by cameronsdad

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

good ideas here thanks guys

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0