Jump to content

WinTitleMatchMode Not working right


Skorn
 Share

Recommended Posts

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
Link to comment
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.
Link to comment
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...

Link to comment
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?
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...