Here is current script:
Code: Select all
//Open Task Manager, and show more details if not already showing
RunProgram>C:\Windows\system32\taskmgr.exe
WaitWindowOpen>Task Manager
SetFocus>Task Manager
Wait>3
UIClick>Task Manager,More details
Wait>3
//Open options, check "Always on top" if unchecked. If checked, close options
UIClick>Task Manager,Options
GoSub>waitImage,alwaysOnTopUnchecked,3
IF>WSI_RESULT=1
UIClick>Task Manager,Always on top
ELSE
UICLICK>Task Manager,Options
ENDIF
wait>1
//Move and resize window
MoveWindow>Task Manager,0,0
ResizeWindow>Task Manager,163,260
//Scroll full right
GetWindowHandle>Task Manager,hWndParent
FindObject>hWndParent,ScrollBar,,6,hWnd,X1,Y1,X2,Y2,result
ObjectSendKeys>hWnd,VK34
ObjectSendKeys>hWnd,VK34
ObjectSendKeys>hWnd,VK34
1) The first item I'd like to improve is that I'm using a subroutine I created called waitImage (not elaborated since I intend to ditch it here) that waits for an image to appear for a user specified number of seconds, then WSI_RESULT will return if it is found. I'm trying wherever possible to use keyboard commands and UI element commands rather than image recognition or ocr tools, so I'd like to see if that's possible here.
Problem is that "Always on top" in Options may or may not already be checked, and as far as I can tell, the checkbox next to it shows nothing for value set, and doesn't respond to me setting the value, so I can click it, but I need to know first if I SHOULD click it.... without looking for an image of it clicked or not. I need some way of either checking the current value, or setting the value.
2) With the mess at the end, I'm basically just trying to scroll full right on the horizontal scrollbar, but I haven't been able to find a keyboard command that does that, so instead I've got this mess of scrolling accross in 3 increments. I've tried a few things involving pagedown or end, but they haven't worked so far.
3) I'm wondering if it's a better practice for any particular reason to launch the Task Manager with the RunProgram> command as above, or to use the keybard Ctrl>Shift>Esc command. Is it ALWAYS better to use key commands, or RunProgram an exception? Is it an issue that the RunProgram command relies on a filepath? Is it possible that the filepath is different on some version of Windows other than 2012r2?
4) It's not in the above script yet, but the other thing I'm trying to do is to sort by Memory in descending order. In this case, I can see that when it is sorted this way, the Memory element does have a set value indicating the descending order, but clicking on it does nothing, and I have so far been unsuccessful setting the value if it needs setting.
thx