Is possible associate a help CHM to a windows button?
AutoIt Window Info says frozen?
Need help. I'm new to installing/using AutoIt. My AutoIt Window Info (x86) says Frozen? Thanks
Open dialog (specifically, CodeWarrior) working intermittently
Hi forum,
I'm struggling with this --- need to script execution of CodeWarrior to compile multiple projects and flash them to a processor (a development board).
I actually I loop through multiple directories with source code, copy files, and then run CodeWarrior to recompile:
#include <File.au3>
Local $files = _FileListToArray ( " ... ", "*", 2)
for $i = 1 to $files[0]
FileCopy (" .... ", "c:\Users\pc-admin\Documents\Project1\src\", $FC_OVERWRITE)
RunWait ("dcc -c -O ..... list of C files")
; I actually need to run an external (command-line) compiler; in CW, the project includes the .o files
Local $cw = Run ("c:/Program Files (x86)/Freescale/CW for MPC55xx and MPC56xx 2.10/bin/IDE.exe")
WinWaitActive ("Freescale CodeWarrior")
Send ("^o")
; Ctrl-O to open the "File Open" dialog box
Local $dlg = WinWaitActive ("Open")
Sleep (1000)
ControlSend ($dlg, "Open", "[Class:Edit]", "c:\Users\pc-admin\Documents\Project1\Project1.mcp")
Sleep (2000)
Send ("!o")
; Alt-O --- click on the OPEN button after having typed in the project name
Ok, so the problem seems to be around here: some times, the text is not entered at all (the dialog
box just freezes --- nothing gets typed in the textbox, and then I can see that the "Open" button is
being pressed, but nothing happens because the filename textbox is empty.
Often enough, I open the Task Manager, forcibly terminate the script (I actually compile it to an
executable, so that it is easier to terminate), and then next time it works like a charm.
Anyone sees any glitches in the above script? Or any similar experiences with CodeWarrior not
working well with AutoIt?
Thanks,
Carlos
--
Write column 1 from 2D array to file
Hi all,
I cant seem to get it working with arrays for some reason.
Basically i want to list all the printers that are installed on a computer and write them to a file.
I am using a print function from HERE but i only want to write column 1 (print names)
#include <Printers.au3> #include <File.au3> #include <Array.au3> $PrinterList = @ScriptDir & "\PrinterList.log" $aPrinterList = _EnumPrinterConfiguration() _FileWriteFromArray ($PrinterList, $aPrinterList) _ArrayDisplay($aPrinterList)
No errors but doesnt work
sleep(1000)
how to pass parameters to a VBA function?
Hi
I have the following VBA statement which i want to run through AutoIT via COM
ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
I have this in AutoIT which works:
$oWord = ObjCreate("Word.Application") $oWord.ActiveDocument.close
But how can i append the VBA function parameter ("SaveChanges=False")?
How to debug running the script line by line?
Hey guys, i'm pretty new here.
I have the modified version of ScITe, I see that Alt+Shift+Tab, you can add debugging msgboxes, but it's cumbersome to do it line by line.
is there anyway to do it easier?
Thank you.
Autoit v3 script has stopped working
When I run my (large) script on a Windows 7 PC (no such problem in XP) I get a dialog:
"Autoit v3 script has stopped working
A problem caused the program to stop working correctly.
Please close the program."
But with trace lines added, I can see in the background that actually my script appears to be working still and I'm wondering if it was caused by some minor COM error (I have a error handler so skip any "Exception Occurred" errors) but may be the COM error signalling to Windows 7 that my script isn't working correctly.
Is it possible for the "Autoit v3 script has stopped working" to be suppressed so that my script can continue working? Is this a Windows 7 error dialogue or an AutoIT message? Thanks!
Tesseract examples wont work for me
Hi Guys
I am trying the tessearct.au3 file with no joy, I have read everything I have found on the forum and can't get anything working.
This is what I have/done
Installed Tesseract 3.02.02 to
C:\Program Files\tesseract\tesseract.exe
Tesseract.au3 is in Autoit3\Include folder, version is
Title: Tesseract UDF Library for AutoIt3
Filename: Tesseract.au3
Description: A collection of functions for capturing text in applications.
Author: seangriffin
Version: V0.6
Last Update: 17/03/09
Changed line 58 to
Global $tesseract_temp_path = @ProgramFilesDir & "\tesseract\tesseract.exe"
Running this simple code
#include <Tesseract.au3>#include <MsgBoxConstants.au3> $OCR_Result = _TesseractScreenCapture(0,"",1,1,94,121,147,166,1) MsgBox(0, "Result: ", $OCR_Result) consolewrite($OCR_Result)
All I get is this screenshot, My os is XP Pro, screen res is 1280 x 800 when installing tessearct it created Tesseract-OCR folder which I renamed to tesseract as most posts I read either showed or stated this change.
If someone could just tell me where I am going wrong or a reason why it wont work that would be greatly appreciated, many thanks.
_Excel_RangeWrite won't write large strings
Hello guys,
I've ran into a little problem that I don't know how to solve. I am creating a 2-dimensional string array. Some of the strings are somewhat large. What I have noticed is that function _Excel_RangeWrite will not write an array where there's a string that exceeds 250+ characters. I have ran into a similar problem when trying to do a replace on a Word document. The workaround was to put a value on clipboard and then paste it. I am fairly new to AutoIT and with a 2-d array I can't quite grasp how to proceed or whether it will even work. Here is a code that I have, that won't put data in an Excel sheet. If you shorten a first member of an $asActs array until the word "period", it will. Any help and workaround is appreciated. Thanks!
#include <WindowsConstants.au3> #include <StaticConstants.au3> #include <ButtonConstants.au3> #include <Excel.au3> #include <array.au3> #include <constants.au3> Local $asActs[2][2] = [["PROVIDING FOR CONSIDERATION OF H. Res. 676, AUTHORIZATION TO INITIATE LITIGATION FOR ACTIONS BY THE PRESIDENT; PROVIDING FOR CONSIDERATION OF H.R. 935, REDUCING REGULATORY BURDENS ACT OF 2013; AND PROVIDING FOR PROCEEDINGS DURING THE PERIOD FROM AUGUST 1, 2014, THROUGH SEPTEMBER 5, 2014", "House Resolution 694"], _ ["EXTENSION OF AFGHAN SPECIAL IMMIGRANT PROGRAM", "H.R. 5195"]] Local $oExcel1 = _Excel_Open() If @error Then Exit MsgBox($MB_ICONERROR, "Excel UDF: _Excel_Open General Leave", "Error creating a new Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oWorkbook = _Excel_BookNew($oExcel1) If @error Then MsgBox($MB_SYSTEMMODAL, "Excel UDF:_Excel_BookNew General Leave", "Error creating the new workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oExcel1) Exit EndIf $oExcel1.ActiveSheet.Columns("A:B").ColumnWidth = 40 If @error Then MsgBox(64, "Excel Bill Sheet", "Error " & @error & " returned by function '_ExcelRowHeightSet' on line " & @ScriptLineNumber) _Excel_RangeWrite($oWorkbook, $oExcel1.ActiveSheet, $asActs, "A1") If @error Then Exit MsgBox($MB_ICONERROR, "Excel UDF: _Excel_RangeWrite General Leave", "Error writing to worksheet." & @CRLF & "@error = " & @error & ", @extended = " & @extended) $oExcel1.ActiveSheet.Columns("B:B").AutoFit
.GetRows help
Hello,
I am trying to limit how much data of a database is put into an array. I am using a Microsoft SQL database and I can extract all the rows of data into an array without problems using the .GetRows.
I am hoping someone can assist me understanding how to use the parameters.
If I do this, I get the first 6000 rows:
$arraySQL = $oRS.GetRows(6000)
What I want is the last 6000 rows, so I have been looking at this site, but I don't understand how to use this.
http://www.w3schools.com/asp/met_rs_getrows.asp#bookmarkenum
i tried doing this, but that doesn't work.
$arraySQL = $oRS.GetRows(6000, $oRS.adBookmarkLast)
I just can't find any code examples on getting that last directory. Lots of post explaining the same thing as the website above, I can't see how to put that into code.
Thanks.
Function (pause within function) call other func, then recontinu where u paused.
So i made a function and within that function i want to call another function IF THE VARIABLE is true, if negative then the script will continu where it was.
E.G in the script
Calling timer on function
I tried getting a timer on a function in this way but it doesnt seem to work, any suggestions
Missing v3.3.12.0 Help Function Reference for _Excel_SheetActivate
The Function Reference for _Excel_SheetActivate is missing from v3.3.12.0 Help. Does this function still exist as it did in v3.3.8.1? Are there other missing Function References?
DllCall confusion
Hello all,
So I've been tinkering with the code above, and for the most part it works, however, when the filepath leads to an au3 script, it doesnt run the script, it instead opens it in scite editor. Of course when I compile the script this is no longer a problem.
I was just wondering why this happens when the script is not compiled.
Thanks in advance
Hyperlink to a File in a Folder Negates Carriage Return in Email
I have some code that dynamically builds what's supposed to be 3 separate lines of info. to send via AutoIt in an email.
Local $body = "Plan Ident: XYZ" & @crlf & @crlf & "Payroll Period: 9/6/2014 - 9/12/2014" & @crlf & "Data File: " & "<a href=""x:\SomeFile.csv"">x:\SomeFile.csv</a>"
If I *don't* include the "href" syntax for making the link to the "x:\SomeFile.csv" file hyperlinked in the email, the above lines show correctly in the email as:
Plan Ident: XYZ
Payroll Period: 9/6/2014 - 9/12/2014
Data File: x:\SomeFile.csv
However, with the "href" used, the @crlf is ignored altogether and my 3 lines of text end up being all strung together in a single line, and it's not very readable:
Plan Ident: XYZ Payroll Period: 9/6/2014 - 9/12/2014 Data File: x:\SomeFile.csv
Any idea at all as to what adjustment I can make to keep the "x:\SomeFile.csv" file hyperlinked in the email plus keep all of the info. on 3 individual lines?
Thanks in advance if anyone has any suggestions.
Trying to use $handle in WinWaitClose opposed to CLASS
Hey everyone long time reader first time posting! I am currently needing some help. I have been hitting my head against the wall trying to figure out a way around this problem but I cannot think of a way. I have a script (it is posted below) that I am wanting go out onto a FTP server and retrieve the latest copy of X. The script uses a batch file to call a javascript to go out and retrieve the file. I then want the program(autoit) to wait until that download is done though it's not working. Once I get the file downloading I have an Autoit command that will unzip the contents into another folder(This is all in the same Autoit file).
That command jumps way ahead and doesn't wait for the file to be downloaded. (Sorry this is so long winded)
What I am currently trying to do is figure out a way of doing a WinWaitClose($handle, "") if that is possible. I have tried having the autoit file to hold based on the class and the title (separate of course) but neither work. I have used the Autoit Window Info tool and this is the information displayed by it.
Sorry for this being such a long post just trying to get some help! Thanks guys!!!
-Rich
>>>> Window <<<<
Title: FVW - WinSCP
Class: ConsoleWindowClass
Position: 75, 75
Size: 677, 342
Style: 0x14EF0000
ExStyle: 0x00040310
Handle: 0x00930378
>>>> Control <<<<
Class:
Instance:
ClassnameNN:
Name:
Advanced (Class):
ID:
Text:
Position:
Size:
ControlClick Coords:
Style:
ExStyle:
Handle:
>>>> Mouse <<<<
Position: 204, 100
Cursor ID: 0
Color: 0xD4E2EF
>>>> StatusBar <<<<
>>>> ToolsBar <<<<
>>>> Visible Text <<<<
#include <MsgBoxConstants.au3> ;Launches JavaScript to retrieve the latest XPlan install Run("C:\Users\NTS User\Desktop\Java\latestinstall.bat") ;Waits for the first dialog window to pop up WinWaitActive("[CLASS:#32770]") Send("{ENTER}") ;Waits for the second dialog window to pop up WinWaitActive("[CLASS:#32770]") Send("{ENTER}") ;Goes to the ftp server and retrieves file WinWaitClose("CLASS:ConsoleWindowClass", "") ;Sleeps for 5 seconds Sleep(5000) ;Unzips the installtion to another folder ShellExecute("C:\Users\NTS User\Documents\AutoInstall\Zip.bat") ;Message window will popup and wait 10 seconds sleep(60000) MsgBox($MB_SYSTEMMODAL, "Pause", "This message box will timeout after 10 seconds or select the OK button.", 10) ;Will make cmdprmt.bat file wait 20 seconds before it will open, giving the javascript time to rename the file Sleep(240000) ;Starts Batch file that will open C# installer and launches Installer.exe ShellExecute("C:\Users\NTS User\Documents\AutoInstall\Autoit\cmdprmt.bat", "") Sleep(25000) Send("!n") ;Waits for XInstaller to display the word success WinWaitActive("XInstaller","Success") ;Runs the bat file to shutdown the virtual Run("C:\Users\NTS User\Desktop\Java\Shutdown.bat")
How to get access to mixed clipboard content
I'm copying text from a web site that includes inline images, and I need to be able to access the full clipboard (not just the unformatted text).
The program InsideClipboard displays a version of the clipboard that it calls "HTML format", which is what I need. One can also save a CLP file using InsideClipboard, and the CLP file (when opened in a text editor) contains the HTML version of the clipboard (along with other binary data).
The AutoHotKey command
FileAppend, %ClipboardAll%, foo.clip
I tried using _ClipBoard_GetData in AutoIt, but none of the data formats that one can specify with it yields the HTML version of the clipboard.
Do you know of a function in AutoIt that produces the same result as
FileAppend, %ClipboardAll%, foo.clip
Thanks
Samuel
PS. The file created by AHK is attached.
Attached Files
Changing the DPI of a BMP
I am trying to set the DPI of a BMP file (not resizing). The program that generated the BMP sets it to 96, and has no options to set it otherwise.
The client requires that this be set to 120 (go figure). I can manually set it using an image editor, but there are more than 1000 images, so I was hoping to do this with a script.
I found UEZ's solution (http://www.autoitscript.com/forum/topic/120163-set-pixels-per-inch-using-gdi/#entry834906) and have tried to modify it to work with the current GDIPlus, but have not been successful. The resulting image created is identical to the original, including the DPI setting of 96.
Any suggestions?
#include <file.au3> #include <GDIPlus.au3> __FixResolution("c:\TestBmp.bmp", 120) Func __FixResolution($sInpath, $iDPI) Local $hImage, $sOutpath, $aResult, $sCLSID $sOutpath = StringLeft($sInpath, StringLen($sInpath)-4) & "_" & $iDPI & ".bmp" _GDIPlus_Startup() $hImage = _GDIPlus_BitmapCreateFromFile($sInpath) $aResult = _GDIPlus_BitmapSetResolution($hImage, $iDPI, $iDPI) $sCLSID = _GDIPlus_EncodersGetCLSID("bmp") _GDIPlus_ImageSaveToFileEx($hImage, $sOutpath, $sCLSID, 0) _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() EndFunc ;==>__FixResolution ; #FUNCTION# ==================================================================================================================== ; Name...........: _GDIPlus_BitmapSetResolution ; Description ...: Sets the resolution of this Bitmap object ; Syntax.........: _GDIPlus_BitmapSetResolution($hBitmap, $nDpiX, $nDpiY) ; Parameters ....: $hBitmap - Pointer to the Bitmap object ; $nDpiX - Value that specifies the horizontal resolution in dots per inch. ; $nDpiX - Value that specifies the vertical resolution in dots per inch. ; Return values .: Success - True ; Failure - False and either: ; |@error and @extended are set if DllCall failed ; |$GDIP_STATUS contains a non zero value specifying the error code ; Remarks .......: None ; Related .......: ; Link ..........; @@MsdnLink@@ GdipBitmapSetResolution ; Example .......; Yes ; =============================================================================================================================== Func _GDIPlus_BitmapSetResolution($hBitmap, $nDpiX, $nDpiY) Local $aResult = DllCall($__g_hGDIPDll, "uint", "GdipBitmapSetResolution", "hwnd", $hBitmap, "float", $nDpiX, "float", $nDpiY) If @error Then Return SetError(@error, @extended, False) $GDIP_STATUS = $aResult[0] Return $aResult[0] = 0 EndFunc ;==>_GDIPlus_BitmapSetResolution
Problem with _WordErrorHandlerRegister() function
Hi
I have a strange problem with the _WordErrorHandlerRegister() function in AutoIT 3.3.8.1.
I have this kind of code
Global $oMyError = ObjEvent("AutoIt.Error", "_errfunc")
and the _errfunc() exists, its my custom error handler.
Then i went from my own VBA commands to the _Word() functions and wanted to include my custom error handler. For this i set it up via:
_WordErrorHandlerRegister("_errfunc")
But as soon as i start the program i get (via the console):
--> Word.au3 Error from function _WordErrorHandlerRegister, $_WordStatus_GeneralError (Error Handler Not Registered - Check existance of error function)
Am i doing something wrong here or is this a bug, as the function already exists?
Best,
Thomy