Jump to content

i'm a new user I need AutoIt to


Recommended Posts

Hi all, I am a new user, actually I have heard about AutoIt recently, I am using a program that I should change parameter values repeatedly and should check the map after every signle parameter changing. I heared once a guy wrote a kinda script and defined the desktop of all PC's at uni in a way that if somebody click on somewhere on desktop AutIT run the program and do the parameter fitting automatically.

Is there any kind of script that help me to do it as a begiiner?

Cheers

Link to comment
Share on other sites

I think your best bet is to read the Help file & search the forum. Welcome to AutoIt.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

I think your best bet is to read the Help file & search the forum. Welcome to AutoIt.

Thanks for reply, but don't have that much time toread all help file, proably better to read those part that I may need based on my target, can u tell me which part I may need more coz as i am getting to underestand it's a very capable software with lots of application.

Link to comment
Share on other sites

I heared once a guy wrote a kinda script and defined the desktop of all PC's at uni in a way that if somebody click on somewhere on desktop AutIT run the program and do the parameter fitting automatically.

MouseGetPos() perhaps, but I didn't understand your question fully.

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

MouseGetPos() perhaps, but I didn't understand your question fully.

it's a windows based software, I should open the program, open some menues and change the number in fields, clicking some icons, this can be repeated by setting different parameters again and again and again.

P.S: So far i managed to write an script that opens the programs and get rid of wellcominbg window(by Send command) , not bad after an hour working with IT :)

Link to comment
Share on other sites

Have a look at ControlSend() & ControlCommand() then. Good luck.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Can you plz give me an example like how I can write this for example by AutiIT, coz i cant underestand ControlID command very well:

-openening micosoft word

-clicking on referencing Mnue-

-clicking on "Insert Endnote"

Thanx in advance it will really help me alot, and the other commnd would be the repeatation of the same,

Link to comment
Share on other sites

but don't have that much time to read all help file

Do you think any of the people here got their knowledge with the same attitude?

guinness is trying to help you by getting you to help yourself, its not a shout until i get some code site you know.

do some reading, formulate exactly what you need, then start writing some code, then when you ask then people will probably help you.

Link to comment
Share on other sites

What Helpers seem to miss and newbies don't understand is that almost every function in the help file has a small example script at the bottom of the page.

The way I learned was to "search" the help file ( its one of the tabs on the help menu )

I just search for opening a word document and got this example ( at the bottom of the page )

; *******************************************************
; Example 1 - Create an empty word window and open an existing document
; *******************************************************
;
#include <Word.au3>
$oWordApp = _WordCreate ("")
$oDoc = _WordDocOpen ($oWordApp, @ScriptDir & "\Test.doc")

Good Luck

8)

NEWHeader1.png

Link to comment
Share on other sites

Here you got a demostration using windows calulator(maybe some things change if you don`t use Win7)

#include <winapi.au3>
If not winexists("[Class:CalcFrame]") then ShellExecute("calc")             ; if calc doesn`t exists, it run it.
Winwait("[Class:CalcFrame]")                                                ; waits until calc exists.
$hndl = WinActivate("[Class:CalcFrame]")                                    ; Active calc, and save the window handle in a variable.
$pos = Controlgetpos("[Class:CalcFrame]","","[CLASS:Button; INSTANCE:5]")   ; Get the position of the button "1".
Msgbox(0,"Position of the button","Position of the control inside the clien area"&@CRLF _
                                    &"The X coord of the control inside the client area is "&$pos[0]&@CRLF _
                                    &"The Y coord of the control inside the client area is "&$pos[1]&@CRLF _
                                    &"The width of the control is "&$pos[2]&@CRLF _
                                    &"The height of the control is "&$pos[3]&@CRLF)
; -----------Preparating the Structure for the function call to get the absolute coords of the control -----------
$tPoint = DllStructCreate($tagPoint)    ; The Struct tagPoint is alreade declared, it has two elements "x" and "y"
DllStructsetdata($tPoint, "x",$pos[0])  ; I put in the element X of the structure the X pos of the control
DllStructsetdata($tPoint, "y",$pos[1])  ; I put in the element Y of the structure the X pos of the control
_WinAPI_ClientToScreen($hndl,$tPoint)

;~ Msgbox(0,"Position of the button","Absolute position of the control"&@CRLF _
;~                                  &"The X coord of the control is "&DllStructgetdata($tPoint, "x")&@CRLF _
;~                                  &"The Y coord of the control is "&DllStructgetdata($tPoint, "y")&@CRLF)

;IF YOU WANT TO SAVE THE DATA INTO VARIABLES YOU SHOULD DO THIS.
$x = DllStructgetdata($tPoint, "x")
$y = DllStructgetdata($tPoint, "y")
$tPoint = 0 ; free the struct.

Msgbox(0,"Position of the button","Absolute position of the control"&@CRLF _
                                    &"The X coord of the control is "&$x&@CRLF _
                                    &"The Y coord of the control is "&$y&@CRLF)
mousemove($x, $y, 15)
sleep(500)
mousemove($x + $pos[2], $y + $pos[3], 15)
sleep(500)
MsgBox(0,"ControlSend","You can send the keys input directly to a control")
ControlSend("[Class:CalcFrame]","","[CLASS:#32770; INSTANCE:1]","123456789")
sleep(1000)
ControlClick("[Class:CalcFrame]","","[CLASS:Button; INSTANCE:13]")
sleep(1000)
For $i = 1 to 9
ControlSend("[Class:CalcFrame]","","[CLASS:#32770; INSTANCE:1]",$i)
sleep(500)
Next
sleep(500)
ControlClick("[Class:CalcFrame]","","[CLASS:Button; INSTANCE:13]")
sleep(500)
MsgBox(0,"Non active window try","Now we gonna try to do this but with the window minimized")
sleep(500)
winsetstate("[Class:CalcFrame]","",@SW_MINIMIZE)
sleep(500)
For $i = 9 to 1 step -1
ControlSend("[Class:CalcFrame]","","[CLASS:#32770; INSTANCE:1]",$i)
sleep(500)
Next
Msgbox(0,"It is the end","This is the end of the demostration, good look")
Link to comment
Share on other sites

Do you think any of the people here got their knowledge with the same attitude?

guinness is trying to help you by getting you to help yourself, its not a shout until i get some code site you know.

do some reading, formulate exactly what you need, then start writing some code, then when you ask then people will probably help you.

===

hey man take it easy and be nice,I am reading and trying I just asked for an example as a favour coz I read about some commands and I couldn't get through it,and the purpuse of these foroums is to help others, I did'nt asked him and you to write me all I need.If you don't want to help just don't post anything no-one forced you to do that.

Link to comment
Share on other sites

If you are totally new, there are some tutorials you can find in the helpfile, and wiki page.

There is also a link in my signature.

====

thanks for your answer , of course i am using help file and examples but the problem is that i'm not at all familiar with programing phrases and coz I just heared about this software found out it can help me alot and save me lots of time, I wring some code and get errors like when it say control ID can't underestadn it, probalby coz english is not my first language is some part and some parts coz of not being familiar with this kind of programming

Link to comment
Share on other sites

What is your native languaje? maybe we can point you to another autoit forum site that can help you in your own languaje.

Also to keep in mind

A window handle is an unique number that identify a window you can have many windows withthe same title on it, but the "windows operating system" will assign an unique numer to identify from the others, internally windows only uses this number to manage the windows.

Every control also have a control handle, but also they have Controls IDs. Control ID is a number that identify the control that are inside a window.

In AutoIt

When you use a GUICtrlCreate... function this will create a control in a GUI and will assign a ControlID and return it to you, so you can handle this control using his ID

For Ex.

$Button = GuiCtrlCreateButton("test",10,10,100,40)

This will create a button with the text "test" on it, with his left upper corner at the 10x10y coords of the GUI, with a size of 100width 40height. and also store into the $Button variable the controlID of that button.

Edited by monoscout999
Link to comment
Share on other sites

====

thanks for your answer , of course i am using help file and examples but the problem is that i'm not at all familiar with programing phrases and coz I just heared about this software found out it can help me alot and save me lots of time, I wring some code and get errors like when it say control ID can't underestadn it, probalby coz english is not my first language is some part and some parts coz of not being familiar with this kind of programming

Ok then in order for you to progress with your problem, you will need to provide more detail.

What application are you trying to automate? have you tried anything at all? if you have then you should post the code and any errors you are getting from it.

Look at the ControlSend() example and run it. Use Autoit Window Info Tool to see how it works to get the Control ID (there is a finder icon in it, drag it over the notepad edit control and see what the information it gives you in the control tab), and then apply it to your application.

You are not going to become familiar with the phrases unless you start to code and post your findings.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Ok then in order for you to progress with your problem, you will need to provide more detail.

What application are you trying to automate? have you tried anything at all? if you have then you should post the code and any errors you are getting from it.

Look at the ControlSend() example and run it. Use Autoit Window Info Tool to see how it works to get the Control ID (there is a finder icon in it, drag it over the notepad edit control and see what the information it gives you in the control tab), and then apply it to your application.

You are not going to become familiar with the phrases unless you start to code and post your findings.

===

thnaks alot, I am getting familliar with some command like msgbox If, Do, ElseIf , what I couldn't get was where I can find Control ID'd now I can find them. My software is called Climex, I need to write an script to be able select different menues and in some windows change the parameters and Run my model. Now I have written a code that opens the software, gets rid of a welcoming message by sending ESC, but for chooing different menues i can't still use ControlSned.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...