Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all 12506 articles
Browse latest View live

How could I automatize MS Word 20XX

$
0
0

I'd like to send some characters to an already existing MSWord (and if possible, to powerpoint too), but I can't find a proper way. I tried to inspect the word and use ControlSend, but it can't be inspected "deeply enough". I did the following thing yet:

ControlSend("[CLASS:OpusApp]", "", "[CLASS:_WwG]", "Anything")

But it's not reliable. If you're not focused on the word "sheet", then it's not working. Do you guys have any better idea? I had a look at word udf, but I'm not sure if it's possible with it. So, any better idea?


Search CD drive letter and send as text

$
0
0

Hello, 

 
I need your help. 
 
I want to do the following:
 
I want to open a file from a CD and will work on different computers, so I want to search the CD drive and then drive letter. The I want to send the drive letter as text.
 
I try the following, but does send nothing.
 
 
$CD = DriveGetDrive("CDROM") If @error Then     MsgBox(4096, "DriveGetDrive", "NO CD!") Else if ubound($CD) = 2 then    ControlSend("Offnen", "", "[CLASS:ToolbarWindow32; INSTANCE:2]", $CD[1])    endif EndIf

 

Some help with SQLite Query

$
0
0

I have SQLite database with one main table "mainTable" and couple daughter tables "daughterTable*" where "*" is from 1 and up (not known before hand)

what i need is to make sqlite query for search entries in main table, which is not exist in any (all) daughter tables.

maybe someone can help

$s_query_string = "SELECT ROWID,* FROM mainTable WHERE " & $columnName & " {is not exist in same column of daughterTable* }" _SQLite_Query($db, $s_query_string, $hQuery) While _SQLite_FetchData($hQuery, $aRow, False, False) = $SQLITE_OK     ConsoleWrite("string --> " & $aRow[1] & " / " & $aRow[3] & @CRLF WEnd

Send function only sends the first letter of Variable

$
0
0

Hi Folks,

First post here, tried searching for a solution but couldn't find anything

I am trying to make a script which adds a new user to an AD domain, I have 4 input boxes each with their on variable

 

$username = InputBox("Enter the new username", "Enter the username")
$firstname = InputBox("Enter the users first name ", "Enter the first name")
$lastname = InputBox("Enter the users last name", "Enter the last name")
$password = InputBox("Enter the users new  password", "Enter the  password", "", "*")
 
what I want to do is parse these variables into a script in a command line window by using this
 
Send("{"& $username&"}") and so on
 
Only the first letter of the variable is actually typed out, for example if I specify the username to be Benjamin it will type out a B
 
Anyone any ideas on how to fix this issue?
 
  1. MsgBox(0, "AD add users", "Let us begin by adding the user to the remote domain!")
  2. Send("{LWIN} powershell")
  3. Send("{ENTER}")
  4. Sleep(1000)
  5. $username = InputBox("Enter the new username", "Enter the username")
  6. $firstname = InputBox("Enter the users first name ", "Enter the first name")
  7. $lastname = InputBox("Enter the users last name", "Enter the last name")
  8. $password = InputBox("Enter the users new  password", "Enter the  password", "", "*")
  9. Sleep(2000)
  10. Send("{"&$username&"} {"&$firstname&"} {"&$lastname&"} {"&$password&"}")
  11. Sleep(10000)
  12. MsgBox(0,"Success", "Script completed successfully, Running on Local AD Server")
  13. Send("{ENTER}")
  14. Send ("C:\Users\Nicky\Desktop\create_ad_users.ps1{ENTER}")
  15. Sleep(1000)
  16. MsgBox(0,"Success", "Script completed successfully, all users have been added")
 

switched from xp to Win7 64bit

$
0
0

Hello,

 

I have a problem with my previous scripts.

 

I used use a WINXP for my scritps, now i had to switch to win7. 

The first thing I tried after I setup the machine was to try to run the scripts and nope :(

 

This is what i try to run.

Plain Text         
#include <IE.au3> #include <Excel.au3> Global $Paused HotKeySet("{ESC}", "Terminate") Func Terminate()     Exit 0 EndFunc $oIE = _IECreate("https://portal") _IELoadWait ($oIE, 1000) Sleep (500) ;;~ Send("{TAB 10}") MouseClick("left", 524, 327, 1, 0) ;Username Sleep (500) Send("username") sleep (50) Send("{TAB}") sleep (1000) Send("pass") sleep (50) Send("{ENTER}") sleep (50) _IELoadWait ($oIE, 1000)

and this is what i get

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\aozben\Desktop\AutoIt3\Projects\Wip.au3"     --> IE.au3 T3.0-1 Error from function _IELoadWait, $_IEStatus_ClientDisconnected (-2147023179, Browser has been deleted prior to operation.) --> IE.au3 T3.0-1 Error from function _IELoadWait, $_IEStatus_InvalidObjectType () --> IE.au3 T3.0-1 Error from function _IELoadWait, $_IEStatus_InvalidObjectType () --> IE.au3 T3.0-1 Error from function _IENavigate, $_IEStatus_InvalidObjectType

I think i am going to have a lot more questions about this winxp to win7 issue, pls be patient with me :)

 

Thanks in advance

 

Alp

 

Can't seem to get Control info

$
0
0

When I run the AutoIt Window Info.exe it works for evertying but the game I want to make an autoclicker for... Any idea how can I get Control info since this .exe doesn't seemt to work in my case. Thank you.

log button & menu click in notepad

$
0
0

hye all, i am new.

 

Can u guys give me an idea how can i log into notepad when user click any button or menu in 1 application (for example microsoft words)?

 

 

 

 

Show location with CTRL Key

$
0
0

Control Panel - Mouse - Pointer Options - Show location of the pointer when i press the CTRL Key

 

I don't want to enable that function with CTRL, i want simulate it with autoit withot using the "autoit internal function" but the real windows "circle effect"

I think is a DLLCall or similar like the window effect-fade but i don't have found any information about that on the web, someone has any idea?

 

EDIT: I think is releated to SystemParametersInfo

It's called SPI_SETMOUSESONAR ( Sonar? Really? :D ) but it only enable-disable, instead i want to "send" that function without click the CTRL

 

Thanks


wxWindowClass etc, widgets problems

$
0
0
Hello everyone. 
I am trying to automate a program that's written using "widgets". It has controls that don't work well with the AutoIt Window Info app, or with spy. For example, one control is of class wxWindowClassNR28, and its text property is "wxlistctrlcolumntitles". The actual displayed text is empty.
It seems to be drawn inside of a control of class "wxWindowClassNR" with text property "CNOwnerDrawSplitterWindow". There are many layered controls. When I use the _WinAPI_GetWindow command to get the children, I have no idea what child control I have from the text or the class name, and since not all of the children are visible or on top, the best I have been able to do is get their coordinates, do a screen capture at the coordinates, use OCR and hope to have it match something I expect. I need a better way. I have tried Junkew's IUIAutomation framework, but did not get anywhere.
I need new ideas.
Has anyone been successful using Autoit on this type of controls?
In case someone is familiar with this, the program is a printing application called CWS.exe, "command work station".
 
Thanks!

How to Multithread

$
0
0

I would like to login in multiple account on a website at the same time, I heard I need to use multithread

but i dont know how to use it on autoit.

help with naming a file

$
0
0

can someone help me figure out how to rename selected files. Look at the before and after naming conventions. Can anyone help get me started in the right direction.

 

before

AR123 Smith, Bob Eye Surgery v1 Full mix.wav

AR123 Smith, Bob Eye Surgery v1 SOT mix.wav

AR123 Smith, Bob Eye Surgery v1 M&E mix.wav

 

after

AR123 Smith, Bob Eye Surgery Full mix v1.wav

AR123 Smith, Bob Eye Surgery SOT mix v1.wav

AR123 Smith, Bob Eye Surgery M&E mix v1.wav

Take control of newly genrated window

$
0
0

Teamcenter is a PDM product that we use. I need to create testing scripts for regression testing. I can log in using an SSO session and IE, but can't seem to take over the window that opens, Here is my code;

 

Run('C:\Siemens\tc83_4tier\portal\portal.bat')
;Sleep(5000)
WinWaitActive("Teamcenter Login - Windows Internet Explorer", "", 20)
Send("Username and Password")
WinWaitActive("https://tcweb01p.fnal.gov:7002/?loginPort=51997&tssv=1.3.2 - Teamcenter Security Agent - Windows Internet Explorer","",20)
;Sleep(15000)
;Send("{ALTDOWN}{TAB}{TAB}{ALTUP}")
WinWaitActive("teamcenter","",20)
Sleep(5000)
Send("{ALTDOWN}f{ALTUP}x")
WinWaitActive("Exit","",2)
Send("y")
 
It works up until I try to make the teamcenter window active. The window header is actually "My Teamcenter - Teamcenter 8". I want to make that window active so that I can run tests. After the last Sleep(5000) the rest of the Autiit script is just to log off of Teamcenter. When I run the script it;
a) runs C:\Siemens\tc83_4tier\portal\portal.bat
b) opens an IE window and asks for a Username and Password
c) I send it 
d) The Teamcenter window gets opened, but I can't do anything inside the window or connect to it
 
Thanks for any and all help,
Bob

 

McAfee Agent Uninstall Failure

$
0
0

Any ideas why this would fail with no reaction? No error, log system or application logs.

 

I'm logged on with a domain admin account.

This is the line that fails even if I run it by itself

Run("C:\Program Files (x86)\McAfee\Common Framework\FrmInst.exe /FORCEUNINSTALL")

Ideally, the actual full script would be something like this.

I tested with msgbox's and the version checker and msgbox works fine up to the line before the Run command, but I can't get the command to actually run.

I tested running a notepad file that I moved to the same Common Framework directory and it ran without error. It's the FrmInst.exe that won't run.

 

Any help or suggestions would be great. We've got about 300 machines with McAfee's 4.0 agent installed and I need to get them up to speed with our other machines.

If @OSArch = "x64" Then     $MCAFEE_AGENT_VER = FileGetVersion("C:\Program Files (x86)\McAfee\Common Framework\FrmInst.exe", "ProductVersion")     If $MCAFEE_AGENT_VER < 4.9 Then         'MsgBox(0,'','64 BIT START AGENT UNINSTALL')         Run("C:\Program Files (x86)\McAfee\Common Framework\FrmInst.exe /FORCEUNINSTALL")     EndIf Else     $MCAFEE_AGENT_VER = FileGetVersion("C:\Program Files\McAfee\Common Framework\FrmInst.exe", "ProductVersion")     If $MCAFEE_AGENT_VER < 4.9 Then         'MsgBox(0,'','32 BIT START AGENT UNINSTALL')         Run("C:\Program Files\McAfee\Common Framework\FrmInst.exe /FORCEUNINSTALL")     EndIf EndIf If @OSArch = "x64" AND FileExists("C:\Program Files (x86)\McAfee\Common Framework\FrmInst.exe") Then     MsgBox(0,'', 'UNINSTALL FAILURE') EndIf

layering my gui to protect it

$
0
0

Hi guys,

I have made GUI what shows info from IE.Now 

there is on part of Gui i need to hide, so i thought is it possible to use something transparent to layer a part of my GUI? 

For example, i have coordinates of IE window  $oIE1, 0, 1, 1000, 790 what i would like to layer with plain white image with has transparent so info would be still visible, but not reachable with right mouse click.

Since i try to make money with my program, i must hide my Webpage source

hotfix checker

$
0
0

Greeting,

 

I am looking for a way to check the windows hotfix installed or not.

 

I have a text file, let us called it "hotfixlist.txt", format like

 

kb12345678

kb12345679

kb12234576

..

...

...

 

 

I want to write a "au3" to check if the machine already installed or not.

 

for example:

 

if not kb12345678 is not installed, just show "kb12345678 is missing", 

 

if not kb12345679 is installed, then just go check next one

 

thanks

 

usera


Problem using serial comms

$
0
0
I'm trying to open a serial port using the CommInterface.au3 library but after going thru

$hFile = _CommAPI_OpenCOMPort(1, 9600, 0, 8, 1)

I always get @error = -1

Any ideas ?

Au3Info and ControlViewer don't show GroupBox controls

$
0
0

I want to get information of a "WipeDisk" window.

 

Zwischenablage01.jpg

 

The information is in a groupbox control. 

Au3Info and Controlviewer show only the progressbar  control, but no other controls with the text below the progressbar.

I need the sectorcount.

 

Zwischenablage02.jpg

 

How to get the sectorcount text?

 

Here my first try.

;~ WipeDisk+ Exit _Main() Func _Main()     $handleW = WinGetHandle("WipeDisk - ")     $handleG = ControlGetHandle($handleW, "", "TGroupBox3")     $text = ControlGetText($handleG, "", "")     MsgBox(262144, "Debug " & @ScriptName, "@Error: " & @error & @LF & "@Extended: " & @extended & @LF & $text, 0) EndFunc   ;==>_Main

Thanks in advance

Exit

 

 

If then ?

$
0
0

I have 5 checkboxes in total. If $T5Checkbox3 is checked how to continue with the rest of the If statements.

If it's unchecked I have another set to run.

 

Edit: script is 5 tabs, 600 lines and growing. this is part of Func _Tab_5

  1. Case $T5Button3
  2.     If GUICtrlRead($T5Input1) = "" Then
  3.         MsgBox(0, "Empty.....", "No Drive Selected!")
  4.         Return
  5.     EndIf
  6.     If GUICtrlRead($T5Checkbox3) = $Gui_Checked Then
  7. ;>>>>>>>>>>>>>>>If $T5Checkbox3 is checked then continue with following If statements If unchecked I have a different set of If statments to run>>>>>>>>>>>>>>>>>>>>>>>>>
  8.         If GUICtrlRead($T5Checkbox1) = $GUI_CHECKED And GUICtrlRead($T5Checkbox2) = $GUI_CHECKED Then
  9.             RunWait(@ComSpec & ' /k "' & @ScriptDir & '\Dism.exe /Capture-Image /ImageFile:"' & GUICtrlRead($T5Input2) & '" /CaptureDir:' & GUICtrlRead($T5Input1) & ' /Name:"' & GUICtrlRead($T5Input4) & ' /description:' & GUICtrlRead($T5Input5) & ' /Compress:' & GUICtrlRead($T5ComboBox1) & ' /CheckIntegrity /Verify', "")
  10.         ElseIf GUICtrlRead($T5Checkbox1) = $GUI_CHECKED Then
  11.             RunWait(@ComSpec & ' /k "' & @ScriptDir & '\Dism.exe /Capture-Image /ImageFile:"' & GUICtrlRead($T5Input2) & '" /CaptureDir:' & GUICtrlRead($T5Input1) & ' /Name:"' & GUICtrlRead($T5Input4) & ' /description:' & GUICtrlRead($T5Input5) & ' /Compress:' & GUICtrlRead($T5ComboBox1) & ' /CheckIntegrity', "")
  12.         ElseIf GUICtrlRead($T5Checkbox2) = $GUI_CHECKED Then
  13.             RunWait(@ComSpec & ' /k "' & @ScriptDir & '\Dism.exe /Capture-Image /ImageFile:"' & GUICtrlRead($T5Input2) & '" /CaptureDir:' & GUICtrlRead($T5Input1) & ' /Name:"' & GUICtrlRead($T5Input4) & ' /description:' & GUICtrlRead($T5Input5) & ' /Compress:' & GUICtrlRead($T5ComboBox1) & ' /Verify', "")
  14.         Else
  15.             RunWait(@ComSpec & ' /k "' & @ScriptDir & '\Dism.exe /Capture-Image /ImageFile:"' & GUICtrlRead($T5Input2) & '" /CaptureDir:' & GUICtrlRead($T5Input1) & '" /Name:' & GUICtrlRead($T5Input4) & ' /description:' & GUICtrlRead($T5Input5) & ' /Compress:' & GUICtrlRead($T5ComboBox1), "")
  16.         EndIf
  17. Case $T5Button4

Window Personal Size & Position

$
0
0

I'm using Win7 64 bits.
I have coded a small script utility that i have added to my explorer toolbar in order to obtain immediately (when i click icon) window dimension and position to value that i have setted into script.
Unfortunately i have 2 problems:

(1st)

 

If the dimension of Left/Right Panel is changed and not equal to value that i want,
in order to obtain the dimension that i want of Left Panel "SysTreeView321" and Right Panel "DirectUIHWND3" i'm using function "MouseClickDrag" to Move sepration column that change dimension of this 2 controls.
Unfortunately this method is not immediately (as for only WinMove) and in addiction
if i move mouse before that script has finished its work, the dimension of 2 controls
is not restored to my configuration but setted to mouse position.

(2nd)

 

If i restore personal dimension and i open new session of explorer.exe it will be opened
with old wrong dimension and i need to click again toolbar icon to re-set custom config.
To take effect also for New session of explorer i must manually change dimension of window
moving window border with mouse because the new dimension setted using "WinMove" is not stored from windows.  Why ?


There is some better solution ?
Thanks

This is my code:

 

AutoIt         
#NoTrayIcon Local $hWindow = WinGetHandle( "[CLASS:CabinetWClass]" )     If Not $hWindow Then EXIT     Local $FromLeft = 37 Local $FromTop = 20 Local $Width = 950 Local $Height = 650 Local $Separation = 346     WinMove( $hWindow, "", $FromLeft, $FromTop, $Width, $Height) Local $MousePos = MouseGetPos() Local $ControlLeftPos = ControlGetPos ( $hWindow, "", "SysTreeView321" ) Local $ControlRightPos = ControlGetPos ( $hWindow, "", "DirectUIHWND3" ) Do     Sleep(5)     Local $WinPos = WinGetPos( $hWindow ) Until $WinPos[0] = $FromLeft Local $Border_vSize = 150 Local $Border_hSize = ( $WinPos[2] - $ControlLeftPos[2] - $ControlRightPos[2] ) / 3 Local $SeparationColumn = $WinPos[0] + $ControlLeftPos[2] + $Border_hSize * 1.5 If $SeparationColumn <> $Separation Then MouseClickDrag ("Left",  $SeparationColumn,  $WinPos[1] +$Border_vSize,  $Separation,  $WinPos[1] +$Border_vSize,   0) MouseMove($MousePos[0], $MousePos[1], 0) ;  Return to previously Mouse Position

Autoit equivalent of vba Format function ?

$
0
0

I am converting some vbscript and vba programs to autoit and cannot find anything that is close to the vba Format(..) function.

 

My current solution is to convert the code manually as follows

 

vba====> filename = Format(Now, """file created in"" mmm ""at"" hh.mm.ss")

autoit==> $filename = "file created in" & @mon & " at " & @hour  & "." & @min & "."  & @sec

 

That works But, it would certainly simplify my conversion efforts if Autoit had something like Format which handles, dates, times am/pm, numbers, rounding, text percentages etc,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Viewing all 12506 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>