Sign in to follow this  
Followers 0
shatteredautumn

Struggling with a small part of my script

4 posts in this topic

#1 ·  Posted (edited)

I am working on a script to pull up several different windows and cycle between them. At the end of each cycle the page is refreshed. I have ran into an issue with our mail inboxes that causes it to lock down the inboxes due to "suspicious" activity because of the refreshes. I'm wanting to add in a check to skip refreshing the inboxes, but to refresh everything else. The page title changes according to the amount of unread emails in the inboxes so it has to account for that.

The title for our inboxes reads like this.

Inbox (N unread) - inbox@company.com - Company Mail - Google Chrome

Inbox (N unread) - inbox2@company.com - Company Mail - Google Chrome

 

This is what I have. I know it doesn't work right, but I'm not sure what to do.

Opt("WinTitleMatchMode", -2)
$InboxCheck=WinGetTitle("", "[active]")
IF NOT ($InboxCheck = "Mail") THEN Send("{F5}")
 
I think what I need to do is just not refresh any page that contains the title "Inbox". How would I accomplish this?
Edited by shatteredautumn

Share this post


Link to post
Share on other sites



Easily check the title with

StringinStr()
1 person likes this

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

Thanks, I got it working.

$InboxCheck=WinGetTitle("", "")
    $StringCheck=(StringInStr($InboxCheck, "Inbox"))
    IF ($StringCheck = 0) THEN Send("{F5}")

Now my next goal is to make it where it reads from a list of page titles to exclude instead of a single title.

Share this post


Link to post
Share on other sites

Here is how I delete a list of files off of user desktops.

You can use the same kind of loop and the FileReadToArray() to run your script in a loop while changing the search string.

Also I assume your using WinActivate() and such and your searching the title but do not forget in times where the title gives you issues you can use the handle or class.

title The title/hWnd/class of the window to activate. See Title special definition.
#RequireAdmin
#Include <File.au3>
#Include <Array.au3>

$ListChoose = InputBox("Black Magic Automation", "Choose The File With Your Desktop Deletion List", "publicsafety.txt")
If @Error Then Exit

$aFile = FileOpen(@ScriptDir & "\" & $ListChoose)
$aFLIST = FileReadToArray($aFile)
;Debug See File List
;_ArrayDisplay($aFLIST)
FileClose($aFile)

For $i = 0 To UBound($aFLIST) -1

;Debug See Current File Name
;MsgBox(0, "", $aFLIST[$i])

$Dfile = $aFLIST[$i]

If $DFile = "" Then $DFile = "youdidnotloseitall.txt"

$folder = StringLeft(@UserProfileDir,StringInStr(@UserProfileDir,"\",0,-1))
$search = FileFindFirstFile($folder&"*")

While 1
    $profile = FileFindNextFile($search)
    If @error Then ExitLoop
    If FileExists($folder&$profile&"\desktop\" & $DFile) Then
        FileDelete($folder&$profile&"\desktop\" & $DFile)
    EndIf
WEnd
FileClose($search)

Next


MsgBox(0, "Black Magic Automation", "Cleanup Completed!")

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  
Followers 0