Guest bhurtel Posted September 2, 2005 Share Posted September 2, 2005 For $i = 1 To 2Run('explorer ' & @WindowsDir & '\Fonts')Sleep(20000)WinClose('Fonts')Nextthis is my script to open font folder for abt 20 sec and after then close the windows....but the script can only open the folder but can close the folderinstead it restores my current displayed font windows.i.e (it restores my maximized font folder and make it half (just as we click restore button) Link to comment Share on other sites More sharing options...
therks Posted September 2, 2005 Share Posted September 2, 2005 The title is case sensitive. My window opened with uppercase "FONTS". Try WinClose('FONTS'). Works for me. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
Holger Posted September 2, 2005 Share Posted September 2, 2005 Or take a look at option WinTitleMatchMode.in this case just use for instance:Opt('WinTitleMatchMode', 2) For $i = 1 To 2 Run('explorer ' & @WindowsDir & '\Fonts') Sleep(20000) WinClose('Fonts') NextSo long... Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
therks Posted September 2, 2005 Share Posted September 2, 2005 Holger: Actually that still fails for me. It demands the WinClose to have uppercase "FONTS". My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
AutoChris Posted September 2, 2005 Share Posted September 2, 2005 Holger: Actually that still fails for me. It demands the WinClose to have uppercase "FONTS".<{POST_SNAPBACK}>I didn't have the same problem when running mine. However, you could also just do this:Opt ("WinTitleMatchMode", 2) For $i = 1 To 2 Run ("explorer.exe " & @WindowsDir & "\Fonts") Sleep(2000) WinClose (@WindowsDir) Next Link to comment Share on other sites More sharing options...
therks Posted September 2, 2005 Share Posted September 2, 2005 (edited) Heh, that wouldn't work for me AT ALL, since the ONLY thing in the title bar of the explorer window that opens for me is "FONTS". *Edit: Although it's odd... if I use explorer to open the folder (like in the script example) the title of the window is all uppercasts (FONTS) if I open the folder from the Run dialog by just typing the path, the title is all lowercase (fonts). ex: Start > Run: "c:\windows\fonts\" > Window with "fonts" for title. Start > Run: "explorer c:\windows\fonts" > Window with "FONTS" for title. Edited September 2, 2005 by Saunders My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
LxP Posted September 2, 2005 Share Posted September 2, 2005 Welcome to the forums!Does your code work correctly if you remove or temporarily disable the For..Next loop? --Run('explorer ' & @WindowsDir & '\Fonts') Sleep(20000) WinClose('Fonts') Link to comment Share on other sites More sharing options...
MHz Posted September 2, 2005 Share Posted September 2, 2005 I certainly do recognize that code . I think Holger may have the solution. 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