Jump to content

Recommended Posts

  • Moderators
Posted

@atvaxtr You could use the AutoIt Window info tool to get title and text of the window, which should then work with WinExists. This works fine for me (pointed at my pictures directory):

If WinExists("Pictures", "C:\Users\LoganJ\Pictures") Then
    WinActivate("Pictures", "C:\Users\LoganJ\Pictures")
Else
    ShellExecute(@UserProfileDir & "\Pictures")
EndIf

Alternatively, you can use WinList to get a list of all windows open that conform to either your title or text specifications, and use that to determine the window's existence. Try something like this to see what I mean:

#include <Array.au3>

_ArrayDisplay(WinList("Pictures", "C:\Users\LoganJ"))

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted (edited)

WOW, first answer = exact solution. What a great feeling :D

Thank you so much JLogan! my code works like a charm now
The second code via Array looks interesting too. I definitly will try it out.

Have a nice day everybody :)

Edited by atvaxtr

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
  • Recently Browsing   0 members

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