autoit

How to use Send() to pass a string like “password#99@TT”?

末鹿安然 提交于 2019-12-02 06:41:49
I am using AutoIt to handle a browser authentication window which Selenium can't access. Below is my AutoIt code. Send("demo") Send("{TAB}") Send("password#99@TT") It only sends password# ; remaining characters 99@TT are skipped. Please let me know how to pass such a string via Send() command . In the documentation of AutoIt about the Send() function you have an option to send RAW. See more documentation here In your case, I would try Send("password#99@TT", 1) Hope this helps! Edit You can try also Send("password{#}99@TT") I have found just now this answer link , I think it can help you. 来源:

How to implement error handling?

拈花ヽ惹草 提交于 2019-12-02 06:35:59
My AutoIt script generates an error that I want to handle. A way that any error goes to a custom function will also do. In VBA I use OnErrorGoTo , but I am unable to find something similar in AutoIt. My Code : Func Start() While 1 If ProcessExists ( "Photoshop.exe" ) <> 0 Then Sleep(5000) Else Local $sFile ="C:\Auto\CodeToBe\Batch\Image Process-50-2D v.2-" & $n & ".jsxbin" Local $iPID = ShellExecute($sFile) Sleep(10000) $n = $n+1 EndIf WEnd EndFunc An error will occur when $n exceeds the number of files in that folder. I tried this but didn't work (from the "HELP SECTION" and a forum post):

Run AutoIt on remote machine using psexec

…衆ロ難τιáo~ 提交于 2019-12-02 05:47:28
I am trying to run an AutoIt script on a remote machine. psexec.exe -accepteula \\remotemachine -u admin -p password "C:\Program Files\AutoIt3\AutoIt3.exe" "C:\Users\admin\runNotepad.au3" I am trying to open a Notepad from the script and write something in it. I am also writing some logs from the script. Although I can see the logs, but I am not able to see anything happening on the screen. I tried with argument -i 0 which opens an interactive screen which is not same as running the script on a local machine. Is there any other way to do it? Finally I was able to figure it out. We should first

初识AutoIt

岁酱吖の 提交于 2019-12-02 02:15:28
1.定义 AutoIt 目前最新是v3版本,这是一个使用类似BASIC 脚本语言 的 免费软件 ,它设计用于Windows GUI( 图形用户界面 )中进行自动化操作。它利用模拟键盘按键,鼠标移动和窗口/控件的组合来实现自动化任务。而这是其它语言不可能做到或无可靠方法实现的(例如 VBScript 和 SendKeys ). 2.功能 (1)运行 Windows 及 DOS 下的可执行文件 (2)模拟键击动作(支持大多数的键盘布局) (3)模拟鼠标移动和点击动作。 (4)对窗口进行移动、调整大小和其它操作。 (5)直接与窗口的“控件“交互(设置/获取 文字、移动、关闭,等等) (6)配合剪贴板进行剪切/粘贴文本操作 (7)对注册表进行操作 3.使用AutoIt 可查询帮助文档 4.初识AutoIt 本人,测试小白,工作有一部分需要点点点,每天重复进多个远程桌面并开登录报盘程序做清库操作,这种重复性工作实属乏味,在网上搜关于自动化脚本出来的大部分是Python、Selenium,而我们的程序是基于C/S架构可能不太适用,正当我发愁时,领导亲切的问候让我第一次了解到AutoIt,下面就简单介绍下如何利用万能小工具AutoIt实现自动登录模拟鼠标点击菜单 5.打个招呼 学习一门新的编程语言写的第一个程序必然是"Hello,World!",首先新建一个脚本文件(右键-新建-AutoIt

Regex in class name to identify controls

笑着哭i 提交于 2019-12-02 01:42:47
问题 A certain program's control ClassnameNN was identified by AutoIt Window Information Tool as: WindowsForms10.BUTTON.app.0.24f4a7c_r27_ad19 in a previous version. In the current version it changed to: WindowsForms10.BUTTON.app.0.24f4a7c_r13_ad19 (notice the changes after r ). How to use a regular expression to solve this problem for future versions? Any workaround too is highly appreciable. 回答1: How to use a regular expression to solve this problem for future versions? Documentation - Intro -

Autorun removable drive

大城市里の小女人 提交于 2019-12-01 02:00:02
Autorun was disabled in Windows. I am looking for an alternative. I got this AutoIt script : $DBT_DEVICEARRIVAL = "0x00008000" $WM_DEVICECHANGE = 0x0219 GUICreate("") GUIRegisterMsg($WM_DEVICECHANGE , "MyFunc") Func MyFunc($hWndGUI, $MsgID, $WParam, $LParam) If $WParam == $DBT_DEVICEARRIVAL Then MsgBox(4096, "Info", "My Drive has been Inserted, Backup My Files!") EndIf EndFunc While 1 $GuiMsg = GUIGetMsg() WEnd Soon as plugged in, the message box appeared. Now, to run a file I replaced MsgBox(4096, "Info", "My Drive has been Inserted, Backup My Files!") by Run ("F:\path\to\my\file.cmd") But

Login to Chrome Authentication window using AutoIT

我是研究僧i 提交于 2019-12-01 01:35:42
I tried login to firefox authentication window by following code : WinWaitActive("Authentication Required","","120") If WinExists("Authentication Required") Then Send("username{TAB}") Send("password{Enter}") EndIf But the same dint worked for chrome even though it has the same title as firefox. Any idea? @Milos @Samoth thanks for spending to solve my query. Using Autoit windows info tool, i could not identify the windows tile in chrome thats not a case in FF or IE. Instead of that "Autentication Required" identified as visible text. So modifying the code to WinWaitActive("","Authentication

Handling Windows authentication pop up

一曲冷凌霜 提交于 2019-12-01 01:32:49
Below is my AutoIt script (UI3_Authentication.au3) for handling a Windows authentication pop up. AutoItSetOption("WinTitleMatchMode","2") WinWait("Authentication Required") $title = WinGetTitle("Authentication Required") ; retrives whole window title $UN=WinGetText($title,"User Name:") ControlSend($title,"",$UN,"test");Sets Username $PWD=WinGetText($title,"Password:") Send("{TAB 1}") ControlSend($title,"",$PWD,"test1234");Sets PWD Send("{ENTER}") Below is my Selenium code call to the above AutoIt exe file. package tests; import java.io.IOException; import org.openqa.selenium.WebDriver; import

Simulate “Windows” key and “+” key to zoom in

北慕城南 提交于 2019-12-01 00:07:36
Windows 7 (finally) has built-in zoom feature for the screen. Hold down the "Windows" key and you can then use the "+" key to zoom in and the "-" key to zoom out. As a result I have been trying to simulate this combination. With AutoIt I have tried: 1) Send("{LWINDOWN}" & "+" & "{LWINUP}") 2) $x = Chr(43) Send("{LWINDOWN}" & $x & "{LWINUP}") 3) Send("#{+}") ;//works but it also sends "+" key 4) Send("{LWINDOWN}") Sleep(10) Send("+",1) Sleep(10) Send("{LWINUP}") None of those 4 steps work... I actually want to use this functionality on c#. If I manage to do it with autoit I could invoke that

Debugging an AutoIt script or get currently executed script line number

馋奶兔 提交于 2019-11-30 17:26:39
问题 My AutoIt script sends a list of clicks and key-presses to automate an old closed source application. It has bugs so I want to know how I can debug AutoIt scripts. Or at least output the script's line number (to show code executed in real time). 回答1: In SciTE from Tools select “Trace: Add trace lines”. This will add a ConsoleWrite to each line if nothing is selected. If you select some code first it will add ConsoleWrite lines to what you have selected. If you are getting an error in your