Jump to content

folder open close script doesn't worked


Guest bhurtel
 Share

Recommended Posts

Guest bhurtel

For $i = 1 To 2

Run('explorer ' & @WindowsDir & '\Fonts')

Sleep(20000)

WinClose('Fonts')

Next

this 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 folder

instead 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

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')
Next

So long...

Link to comment
Share on other sites

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

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

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

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...