seanz123

Im sure there a better way

2 posts in this topic

#1 ·  Posted (edited)

I created a script to automate filling in information from our SAN at my company. I have completed what i want it to do but im sure there is an easier way of doing it. for example i have to make the script Sleep to wait for the java windows to load. Any thoughts or advice will be appreciated.

;make active
WinActivate("EMC Unisphere - Windows Internet Explorer")

;Move IE window
MouseMove (587, 8, 1)
MouseDown("Left")
MouseMove(1880,181,3)
MouseUp("Left")
Sleep(3000)

;maximize
WinSetState("[ACTIVE]", "", @SW_MAXIMIZE)
Sleep(3500)

;Select FTPCNTCS0
MouseMove (1342, 194, 1)
MouseClick("Left")
Sleep(500)

;Select File Systems
MouseMove (1782, 86, 1)
Sleep(1700)
MouseMove(1816,364,1)
MouseClick("Left")
Sleep(2400)

;Select Server------------------------------------------------------------ 1
MouseMove(1429,420,1)
MouseClick("Left")
MouseClick("Left")
Sleep(9500)

;Move IE window
MouseMove(629,170,1)
MouseDown("Left")
MouseMove(1880,181,3)
MouseUp("Left")
Sleep(2000)

;Copy Files Scanned
MouseMove(2052,485,1)
MouseDown("Left")
MouseMove(1994,485,5)
MouseUp("Left")
MouseMove(2020,485,1)
MouseClick("Right")
sleep(300)
MouseMove(2050,522,1)
MouseClick("Left")
sleep(1000)

; Create application object
Local $oAppl = _Excel_Open()

; Open an existing workbook
Local $sWorkbook = @ScriptDir & "\AutoSAN.xlsx"
Local $oWorkbook = _Excel_BookOpen($oAppl, $sWorkbook, Default, Default, True)

;make active
WinActivate("Microsoft Excel - SAN Monthly Reports.xlsx")

Sleep(500)

;maximize
WinSetState("[ACTIVE]", "", @SW_MAXIMIZE)

Sleep(1000)

$oWorkbook.ActiveSheet.Range("D11").Select()

;Paste Files Scanned
MouseMove(249,172,1)
MouseClick("Left")
Send("{CTRLDOWN}v{CTRLUP}")
Send("{TAB}")

;Copy Files Deduped

MouseMove(2052,502,1)
MouseDown("Left")
MouseMove(1994,502,5)
MouseUp("Left")
MouseMove(2020,502,1)
MouseClick("Right")
sleep(300)
MouseMove(2050,539,1)
MouseClick("Left")

;Paste Files Deduped

MouseMove(249,172,1)
MouseClick("Left")
Sleep(500)
MouseClick("Left")
Send("{CTRLDOWN}v{CTRLUP}")
Send("{TAB}")
Send("{TAB}")

;Copy Oirginal Data Size
MouseMove(2052,519,1)
MouseDown("Left")
MouseMove(1994,519,5)
MouseUp("Left")
MouseMove(2020,519,1)
MouseClick("Right")
sleep(300)
MouseMove(2050,556,1)
MouseClick("Left")

;Paste Oirginal Data Size
MouseMove(249,172,1)
MouseClick("Left")
Sleep(500)
MouseClick("Left")
Send("{CTRLDOWN}v{CTRLUP}")
Send("{ENTER}")

;Close IE Window
MouseMove(2319,178,1)
MouseClick("Left")

 

Edited by Melba23
Added code tags

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

seanz123,

When you post code please use Code tags - see here how to do it.  Then you get a scrolling box and syntax colouring as you can see above now I have added the tags.

M23

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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