Jump to content

help to Identify a Specific Client Application, take screen capture, save the jpeg file to UNC location

Recommended Posts

I am new to AutoIT but I do use Sikuli.  Decided to use AutoIT for  this project as all  the required can be created in an .exe file, does not  need Java like Sikuli.

Also  which can be pushed to tool bar of Windows 10 desktop.

Our users will interact with a client/server application and normally work on dual screen. The script needs to detect the c/s application from the dual screen,  needs to do three mouse clicks based of image/pixel comparison, will need to wait till the  click object is available and then finally take screen capture  of the top 40 rows  and save the .jpeg file to  windows file share location.

once the file save is completed,  pop up message - the screen capture is completed. Then the users can do their regular work.

Potentially  other factor that will play are the screen resolution.

Can anyone guide me to some relevant scripts already in the forum. In the meantime I am learning  the basics of the  tool.


Appreciate feedback and any help

George V



Link to post
Share on other sites

Hello and welcome to AuoitScript forum


well not even difficult... 

btw i don't use windows 10

i just have some questions:

When they got a secondary screen, you need the full range ? i mean full desktopwidth or you just need screencapture 1 screen? When which?

I would need more informations ... like which pixel u need or which mouseclicks... is it on desktop or in an application and so on... a screenshot would be nice

i dont know what you mean with save to windows file sharing because i never used...

unfortunately there is no way to capture "rows" but you could it handle with pixels

Problem would be when they have different resolutions ... so you have to compare it to the "rows"


at least i hope you know nobody will give you a finished script for this... so you have some starts? some code? i mean it's just a forum and we are ready to help but not to work for you :naughty: Hope you dont get me wrong for this :P 


Here is an example to get resolutions for all Displays .. but it works with powershell and i dont know if this works on Win 10 (would be nice to know :) )

(you need to DL the file and get this in same folder)

#include <Array.au3>
_ArrayDisplay (_get_screen_info())

Func _get_screen_info()
Dim $displayresolutions[0][0]
If IsAdmin ( ) Then

FileInstall ( @ScriptDir & '\screens.ps1',@ScriptDir & '\screens.ps1',0 )

Until FileExists("screens.ps1")

If FileExists("screens.txt") Then FileDelete("screens.txt")
Until FileExists("screens.txt") <> 1

RunWait(@ComSpec & ' /c PowerShell.exe -ExecutionPolicy Bypass -File "' & @ScriptDir & '\screens.ps1"', "", @SW_HIDE)

Until FileExists("screens.txt")

Local $lines = FileReadToArray("screens.txt")

_ArrayDelete($lines, UBound($lines) - 1)

For $i = 0 To UBound($lines) - 1
    ReDim $displayresolutions[UBound($displayresolutions) + 1][3]
    Local $array = StringRegExp($lines[$i], "[A-Z]+[0-9]", $STR_REGEXPARRAYGLOBALMATCH, 1)
    $displayresolutions[$i][0] = $array[0]
    Local $array = StringRegExp($lines[$i], "\s[0-9]+", $STR_REGEXPARRAYGLOBALMATCH, 1)
    $displayresolutions[$i][1] = $array[0]
    $displayresolutions[$i][2] = $array[1]
Return $displayresolutions
    SetError ( -10,0,-10 )
    Dim $errorreturn = "no admin rights"
    Return $errorreturn


Edited by Aelc

why do i get garbage when i buy garbage bags? <_<

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

    No registered users viewing this page.

  • Similar Content

    • By pete_wilde
      Hi Guys,
      As I am still finding my feet with AutoIT, I thought that I would do a quick test.
      I therefore created some HTML code to create a small yellow non-functioning test button on a web page.
      <td><div class="wg-button"><a style="position:relative" href="javascript:void(1)"><img src="button.png" alt=""> <span style="position:absolute;left:17px;top:31px; cursor:pointer; width:126px;">TEST</span></a></div></td> I then tried to see if AutoIT could detect if I clicked on the button link.
      #include <Misc.au3> #include <Msgboxconstants.au3> LOCAL $sPos LOCAL $sColor LOCAL $sYellow = "#FFFF00" While 1 $sPos = MouseGetPos() $sColor = Hex(PixelGetColor($sPos[0], $sPos[1])) $sColor = "#" & StringMid($sColor,3) ToolTip($sColor) If (_IsPressed("01") = True) And ($sColor = $sYellow) Then MsgBox (262144,"Found it","X=" & $sPos[0] & " Y=" & $sPos[1]) EndIf Wend The code correctly detects when I click on the button.
      However, it also highlights on anything else yellow (e.g. a yellow background) that I click on, not just the button.
      I did change the link from "empty" to "www.google.com" and then checked if the current browser URL changed also, thereby indicating that I clicked on a yellow link rather than just a yellow background. That worked fine.
      However, as it is about improving my knowledge of AutoIT rather than for a specific project, can anyone think of another way which I could do it?
      Detecting a URL change is fine, but I then end up on a new page i.e. www.google.com.
      I would like to see if I can do it without changing the size.
      Any ideas?
      Many thanks,
    • By Tony007
      is it possible to export only the area "$idOutput" with the TEXT as a PNG?
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> Example() Func Example() Local $hGUI = GUICreate("Test", 700, 700, -1, -1) Local $input1 = GUICtrlCreateInput("", 10, 10, 150, 20) Local $idButtonStart = GUICtrlCreateButton("Start", 200, 10, 50, 30) Local $idButtonClear = GUICtrlCreateButton("Clear", 260, 10, 50, 30) Local $idButtonExport = GUICtrlCreateButton("Export", 320, 10, 50, 30) Local $idOutput = GUICtrlCreateLabel("TEXT", 10, 50, 500, 500, BitOR($BS_PUSHLIKE, $SS_CENTER)) GUICtrlSetFont($idOutput, 45, 800, "", "Impact") GUISetState(@SW_SHOW, $hGUI) ; Run the GUI until the dialog is closed While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idButtonStart $ContentInput1 = GUICtrlRead($input1) GUICtrlSetData($idOutput, $ContentInput1) Case $idButtonClear GUICtrlSetData($input1, "") GUICtrlSetData($idOutput, "") Case $idButtonExport EndSwitch WEnd GUIDelete($hGUI) Exit EndFunc ;==>Example  
    • By nooneclose
      Good morning, I have been thinking about trying to make my Autoit script run in the background. I found out today that it is impossible due to the UIA and mouseclick functions that I use. However, while reading other posts about running Autoit scripts in the background I saw a reply mentioning how a script like mine might be able to run on a VM while still giving me the ability to work on my Host OS. Can someone confirm this? 
      Here is a link to the thread where I saw VM mentioned. 
      the person who mentioned it was @ViciousXUSMC 
    • By Jefrey
      Needed a way to store global temporary & permanent information and came up with this.
      This is inspired by NodeJS's store and store2 packages, as well as W3 specs' localStorage and sessionStorage, offering multiple ways of usage.
      This is not related to any browser's storage, nor will allow you to access or modify browsers storage - although this is possible and not a hard task, this is not what this UDF is intended to do.
      This UDF offers functions for temporary storage (that gets cleaned up once the application is shutdown) that is kept on memory using ScriptingDictionary, as well as for permanent storage, that is saved on the harddisk as an encrypted file.
      sessionStorage (temporary storage)
      It's useful to keep application state and temporary settings accessible by any part of your script (although it could also be done with a global variable, I still prefer this method).
      You have multiple ways, at your choice, to:
      ; add or modify a key sessionStorage("foo", "bar") store("foo", "bar") sessionStorage_set("foo", "bar") sessionStorage_setItem("foo", "bar") ; read a key (returns false if key does not exist) $read = sessionStorage("foo") $read = store("foo") $read = sessionStorage_get("foo") $read = sessionStorage_getItem("foo") ; delete a key sessionStorage_remove("foo") ; delete all keys sessionStorage_clear() sessionStorage_clearAll() localStorage (permanent storage)
      It's useful to store user-defined settings.
      ; initialize ; this is optional, but allows you to control ; how things are going to be saved localStorage_startup([file where you want the settings to be saved], [crypt password]) ; by default, if not supplied, if supplied the "Default" keyword (or if you dont initialize), ; the file will be a random-named file (based on @ScriptFullPath) at user's %APPDATA% ; and the password will also be based on @ScriptFullPath ; you can set only the crypt password if you want: ; localStorage_startup(Default, "mypassword") ; the usage is the same as sessionStorage ; add or modify a key localStorage("foo", "bar") store2("foo", "bar") ; notice the '2' localStorage_set("foo", "bar") localStorage_setItem("foo", "bar") ; read a key (returns false if key does not exist) $read = localStorage("foo") $read = store2("foo") $read = localStorage_get("foo") $read = localStorage_getItem("foo") ; delete a key localStorage_remove("foo") ; delete all keys localStorage_clear() localStorage_clearAll() Download
    • By davidacrozier
      Hello all ~
      I am running an autoit script on Windows 10 inside VMware Workstation 12 Pro version 12.5.2.  Technically I am remoting into ESXi which has a Domain Controller (DC), WebServer, FilServer, Windows 10, etc.  Using the GUI (i.e. running explorer.exe) I am able to open several different folders successfully.  The desktop, documents, USB external all open without issue.  The network share opening gives me issues.  Whenever I attempt to open \\filserver\users\user\sharedfolder I get the documents folder instead.  I understand that the documents folder is the default for explorer.  I have also attempted to use the letter drive mapped to the network share (Z:) and receive the same result.  When I run this script on Windows 10 alone without  the VM or the ESXi I am able to open the network share without problems.  I have tried to use the net use command to designate a letter M: to the network share folder prior to running the script.  This did not work for me.  
      One additional avenue I think might work is to use the systreeview321 and _GUICtrlTreeView_FindItem to step through the tree looking for the network share.  Once found,  double click on it and see if that opens the shared network folder.  I can click inside the VM with my mouse on the network share and it opens just fine.  Not sure if running up against GUI issues, or permission issues, or what?
      Thanks in advance,
      Davida Crozier
      This script is a subset of a much larger program, but it illustrates what I am dealing with.

  • Create New...