Mantris Posted August 3, 2006 Share Posted August 3, 2006 hi, i am writing on a script that should change some outlook express settings. my problem is that i am not able to activate outlook express if "Outlook Express" is not the begin of the window-title. If the inbox is activated then the window-title is something like "Inbox - Outlook Express" - and this is the point where i get in trouble with using winactivate. This is my code: Opt("WinTitleMatchMode", 2) Opt("WinTextMatchMode", 2) $title = WinGetTitle("Outlook Express") WinActivate($title) What am I doing wrong? Thanks in advance Link to comment Share on other sites More sharing options...
MHz Posted August 3, 2006 Share Posted August 3, 2006 You have already set the Opt() for substring, so just use the substring. Opt("WinTitleMatchMode", 2) Opt("WinTextMatchMode", 2) WinWait("Outlook Express"); wait for window $title = WinGetTitle("Outlook Express"); get full title WinActivate($title); activate window WinWaitActive($title); wait for window to become active WinGetTitle() is perhaps not needed to use unless another window appears that may have the same substring in the title. Link to comment Share on other sites More sharing options...
Mantris Posted August 3, 2006 Author Share Posted August 3, 2006 (edited) Hi MHz, thanks for your very quick answer!!! I tried your script but Outlook Express still won't activate until "Outlook Express" is at the beginning of the window-title... I am using the german version so don't worry about the titles... They are: "Outlook Express - Hauptidentität": Everything works fine "Posteingang - Outlook Express - Hauptidentität": Activation of the window won't work "Postausgang - Outlook Express - Hauptidentität": Activation of the window won't work, too Maybe it depends on the "ä" in the title? Edited August 3, 2006 by Mantris Link to comment Share on other sites More sharing options...
MHz Posted August 3, 2006 Share Posted August 3, 2006 (edited) Maybe it depends on the "ä" in the title?Works for my English version. The accented character could be the issue. Test with a MsgBox to confirm. Opt("WinTitleMatchMode", 2) Opt("WinTextMatchMode", 2) WinWait("Outlook Express"); wait for window $title = WinGetTitle("Outlook Express") MsgBox(0, 'Check title', $title); show full title in msgbox WinActivate($title); activate window WinWaitActive($title); wait for window to become active Edit: An issue I found myself through the test when select Outbox. OutLook Express would not activate as the title was different. I have 3 windows titles I get the 1st returned so ruins the activation of following functions. Outlook Express FolderSync Window Class (Hidden) Outlook Express (hidden) Outbox - Outlook Express (visable) Edited August 3, 2006 by MHz Link to comment Share on other sites More sharing options...
Mantris Posted August 3, 2006 Author Share Posted August 3, 2006 (edited) THX Here are the results (tested on the 3 folders as listed above): - "Outlook Express - Hauptidentität": correct - "Outlook Express FolderSync Window Class": hmmm... - "Outlook Express FolderSync Window Class": hmmm, too But no matter if the title is wrong... "Outlook Express" is always part of the title... This is confusing me a little bit... EDIT: Sorry, i was too slow Edited August 3, 2006 by Mantris Link to comment Share on other sites More sharing options...
JSThePatriot Posted August 3, 2006 Share Posted August 3, 2006 Have you tried leaving out the WinGetTitle()? It seems you would need to use this pretty often throughout your script, where as if you leave that out it should just go by the "Outlook Express" that is in each title. Dim $title = "Outlook Express" Opt("WinTitleMatchMode", 2) Opt("WinTextMatchMode", 2) WinWait($title); wait for window WinActivate($title); activate window WinWaitActive($title); wait for window to become active ;Do something once window is active. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
MHz Posted August 3, 2006 Share Posted August 3, 2006 (edited) THX Here are the results (tested on the 3 folders as listed above): - "Outlook Express - Hauptidentität": correct - "Outlook Express FolderSync Window Class": hmmm... - "Outlook Express FolderSync Window Class": hmmm, too But no matter if the title is wrong... "Outlook Express" is always part of the title... This is confusing me a little bit... EDIT: Sorry, i was too slow Get the handle using classname to avoid the other titles Opt("WinTitleMatchMode", 4) Opt("WinTextMatchMode", 2) WinWait("classname=Outlook Express Browser Class"); wait for window $handle = WinGetHandle("classname=Outlook Express Browser Class"); get handle WinActivate($handle); activate window WinWaitActive($handle); wait for window to become active Edited August 3, 2006 by MHz Link to comment Share on other sites More sharing options...
Mantris Posted August 3, 2006 Author Share Posted August 3, 2006 @JS Thanks, but that won't work, too... @MHz That's it! Many THX and best wishes from good-old germany to australia Link to comment Share on other sites More sharing options...
MHz Posted August 3, 2006 Share Posted August 3, 2006 That's it! Many THX and best wishes from good-old germany to australia Your welcome. Link to comment Share on other sites More sharing options...
JSThePatriot Posted August 3, 2006 Share Posted August 3, 2006 @JSThanks, but that won't work, too... @MHzThat's it! Many THX and best wishes from good-old germany to australia Well I am glad you got it resolved.I am curious as to why it wasnt working though. I know sometimes I have gotten errors when I have told it I will be using a "sub string" and then used the whole title, which was the entire basis for my posting the above code.GJ MHz as always JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) 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