Jump to content
Sign in to follow this  

Check Active Window?

Recommended Posts

I know how to check if a window's active at a time, but I don't know how to check if a window's active while the program's in progress.

Is there a way to do it? Here's my script:

;Get File Count and Folder Name
    $FolderName=FileSelectFolder ("Choose the folder","",0)
  if $FolderName = 1 then
    Run("explorer " & $FolderName)
    sleep (1000)
    $title=wingettitle ("")
    winactivate ($title)
    sleep (1000)
    $search = FileFindFirstFile($FolderName & "\*.*")
    While 1
     $file = FileFindNextFile($search)
     If @error = 1 Then ExitLoop
     $NumberofFiles=$NumberofFiles + 1
;Start adding the number's
    send ("!vd{Space}{F2}{Home}01-{Enter}")
    if $NumberofFiles = 1 then
  sleep (1000)
  send ("!vn")
  msgbox (0, "Finished", "Finished")
  send ("{Down}{Space}{F2}{Home}")
  if $i <= 9 then
     send ("0" & $i & "-{enter}")
  if $i >=10 then
     send ($i, 1)
     send ("-{Enter}")
    until $i = $NumberofFiles + 1
    sleep (1000)
    send ("{!vn}")
    msgbox (0, "Finished", "Finished")

Share this post

Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...