Skorn Posted August 18, 2005 Share Posted August 18, 2005 (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 August 18, 2005 by Skorn Link to comment Share on other sites More sharing options...
alex146089 Posted August 18, 2005 Share Posted August 18, 2005 what is the problem what are you trying to do all work for me sorry for my english Link to comment Share on other sites More sharing options...
Skorn Posted August 18, 2005 Author Share Posted August 18, 2005 what is the problemwhat are you trying to doall work for mesorry for my english <{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 More sharing options...
seandisanti Posted August 18, 2005 Share Posted August 18, 2005 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?ThanksOpt("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 hereor you could do your own substring search:Opt("WinTextMatchMode",4) $ActName = WinGetTitle("active","") if StringInStr($ActName,"Outlook Express") Then ;... your code hereor 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 More sharing options...
alex146089 Posted August 18, 2005 Share Posted August 18, 2005 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 Link to comment Share on other sites More sharing options...
seandisanti Posted August 18, 2005 Share Posted August 18, 2005 Opt("WinTitleMatchMode", 2)Run ("C:\Program Files\Outlook Express\MSIMN.EXE")Sleep ( 300 )While 1WinWaitActive("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 More sharing options...
alex146089 Posted August 18, 2005 Share Posted August 18, 2005 and you never see your msgbox?<{POST_SNAPBACK}>every time when outlook is active or front most on screenI see my msgbox Link to comment Share on other sites More sharing options...
seandisanti Posted August 18, 2005 Share Posted August 18, 2005 (edited) every time when outlook is active or front most on screenI see my msgbox <{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 August 18, 2005 by cameronsdad Link to comment Share on other sites More sharing options...
Skorn Posted August 18, 2005 Author Share Posted August 18, 2005 good ideas here thanks guys Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now