Leaderboard
Popular Content
Showing content with the highest reputation on 08/22/2016 in all areas
-
Probably because windows wont allow you to save a file with back slashes/forward slashes\ in it. Try using _NowDate() and StringReplace and replace the " / \ " with "." for instance... p.s. unless you are dead set on using SnippetTool, Autoit has a very cool function called: _ScreenCapture_Capture that does this job very well2 points
-
WinHTTP Send with Complex Send Parameters
sivaramanm reacted to Jos for a topic
@sivaramanm, no need to created a second thread on the same topic, so please stick to one topic going forward. Merged. Jos1 point -
Maybe like this: ....... ....... ....... _Example($oIE) ....... ....... ....... Func _Example(ByRef $oIE) ; <INPUT onmouseover=onMouseOverButtonHandler(this); onfocus=onMouseOverButtonHandler(this); onmouseout=onMouseOutButtonHandler(this); onblur=onMouseOutButtonHandler(this); class=button accessKey=o type=submit value=OK> ; https://www.w3.org/TR/css3-selectors/#selectors ; find INPUT tag with attribute onmouseover="onMouseOverButtonHandler(this)" Local $oSelection = _IEquerySelectorAll($oIE, 'input[onmouseover="onMouseOverButtonHandler(this)"]', 0) If Not @error Then _IEAction($oSelection, 'click') EndFunc ;==>_Example ;#FUNCTION#============================================================================================================= ; Name...........: _IEquerySelectorAll() ; Description ...: Returns an Object or a Colection of objects ; Syntax.........: (ByRef $oDoc, $sQuery, $iItemIndex = Default) ; Parameters ....: $oDoc - The document object from IE ; $sQuery - String of Query. Example: _IEquerySelectorAll($oDoc, '"div.note, div.alert"', Default) will return a colection of div elements with classes of note and alert ; $iItemIndex - [optional] Default returns a colection, else use a 0 based index to indicate the object in sequence ; Return values .: Success - Object or a Colection of objects ; Failure - returns 0 sets the @error flag to non-zero. ; 3 ($_IEStatus_InvalidDataType) - Invalid Data Type ; 4 ($_IEStatus_InvalidObjectType) - Invalid Object Type ; 5 ($_IEStatus_InvalidValue) - Invalid Value ; 7 ($_IEStatus_NoMatch) - No Match ; Author ........: XThrax aka uncommon ; Remarks .......: This fuction was pretty much stolen from Dale Hohm the IE UDF creator so much credit to him, also to mLipok who made the error checking better. ; Also note that this a relatively recent add-on to IE so it requires IE 9 and above. ; If you find you receive a com error of "unknown name" its likely the site is using meta tag attribute X-UA-Compatible which has reverted the browser to forget about it. ; ; Related .......: _IETagNameAllGetCollection();_IEClassNameGetCollection() ; Link ..........;https://www.autoitscript.com/forum/topic/181376-_iequeryselectorall/ ; https://msdn.microsoft.com/en-us/library/cc304115(v=vs.85).aspx ; Example .......; No ; ===================================================================================================================== Func _IEquerySelectorAll(ByRef $oDoc, $sQuery, $iItemIndex = Default) If Not IsObj($oDoc) Then ConsoleWriteError("--> _IEquerySelectorAll Error: " & $_IEStatus_InvalidDataType & " Invalid DataType" & @LF) Return SetError($_IEStatus_InvalidDataType, 1, 0) ElseIf Not __IEIsObjType($oDoc, "browserdom") Then ConsoleWriteError("--> _IEquerySelectorAll Error: " & $_IEStatus_InvalidObjectType & " Invalid ObjectType" & @LF) Return SetError($_IEStatus_InvalidObjectType, 2, 0) ElseIf Not IsNumber($iItemIndex) And $iItemIndex <> Default Then ConsoleWriteError("--> _IEquerySelectorAll Error: " & $_IEStatus_InvalidValue & " Invalid Index" & @LF) Return SetError($_IEStatus_InvalidValue, 3, 0) ElseIf $iItemIndex = Default Or $iItemIndex >= 0 Then Local $oTemp = Null If __IEIsObjType($oDoc, "documentcontainer") Then $oTemp = _IEDocGetObj($oDoc) If @error Then Return SetError(@error, @extended, 0) Else $oTemp = $oDoc EndIf Local $oClassColl = $oTemp.querySelectorAll($sQuery) If @error Then ConsoleWriteError("--> _IEquerySelectorAll Error: " & $_IESTATUS_GeneralError & " GeneralError1: " & @error & @LF) Return SetError($_IESTATUS_GeneralError, 3, 0) ElseIf (Not IsObj($oClassColl)) Or $oClassColl = Null Or $oClassColl.length = 0 Then ConsoleWriteError("--> _IEquerySelectorAll Error: " & $_IEStatus_NoMatch & " NoMatch" & @LF) Return SetError($_IEStatus_NoMatch, 0, 0) ; Could be caused by parameter 2, 3 or both Else If $iItemIndex = Default Then Return SetError($_IEStatus_Success, $oClassColl.length, $oClassColl) ElseIf $iItemIndex > $oClassColl.length Then ConsoleWriteError("--> _IEquerySelectorAll Error: " & $_IEStatus_InvalidValue & " Invalid Value" & @LF) Return SetError($_IEStatus_InvalidValue, $oClassColl.length, 0) Else $oItem = $oClassColl.Item($iItemIndex) If @error Then ConsoleWriteError("--> _IEquerySelectorAll Error: " & $_IESTATUS_GeneralError & " GeneralError2: " & @error & @LF) Return SetError($_IESTATUS_GeneralError, 3, 0) ElseIf (Not IsObj($oItem)) Or $oItem = Null Then ConsoleWriteError("--> _IEquerySelectorAll Error: " & $_IEStatus_NoMatch & " NoMatch Index: " & $iItemIndex & @LF) Return SetError($_IEStatus_NoMatch, 0, 0) ; Could be caused by parameter 2, 3 or both Else Return SetError($_IEStatus_Success, 0, $oItem) EndIf EndIf EndIf Else ConsoleWriteError("--> _IEquerySelectorAll Error: " & $_IEStatus_InvalidValue & " Invalid Value: " & $iItemIndex & @LF) Return SetError($_IEStatus_InvalidValue, 3, 0) EndIf EndFunc ;==>_IEquerySelectorAll btw. Please also read this: How to use IE.au3 UDF with AutoIt v3.3.14.x1 point
-
Control Viewer - AutoIt Window Info Tool
argumentum reacted to Sourov19 for a topic
@Yashied. I am not getting download link. Would you help me please. Oh! sorry. After posting I have seen related to my post. There Link is given. So thanks "argumentum"1 point -
Little help for Mouse and form
SalamanderSoup reacted to AutoBert for a topic
Please use code-tag's ( <> ) next time. The script wouldn't run: >Running AU3Check (3.3.14.2) from:C:\Program Files\AutoIt3 input:C:\Users\Bert\AutoIt3.My\Temp\test3.au3 "C:\Users\Bert\AutoIt3.My\Temp\test3.au3"(22,1) : error: missing EndIf. wend ^ "C:\Users\Bert\AutoIt3.My\Temp\test3.au3"(12,34) : REF: missing EndIf. If _IsPressed("11", $hDLL) Then ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\Users\Bert\AutoIt3.My\Temp\test3.au3"(12,28) : error: _IsPressed(): undefined function. If _IsPressed("11", $hDLL) ~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\Bert\AutoIt3.My\Temp\test3.au3 - 2 error(s), 0 warning(s) !>15:04:07 AU3Check ended. Press F4 to jump to next error.rc:2 +>15:04:07 AutoIt3Wrapper Finished. and after correcting the errors it will ignore mousemove and set allways the mousecoords from script begin.1 point -
Hi, I went looking for an algorithm and I found one thanks to jchd's links to OEIS. It is blindingly fast - I get the 14-bit result in ~150ms on my machine. Anyway, here it is for completion: #include "Array.au3" $nBegin = TimerInit() ; Set number of bits $iMax = 14 ; Create array to hold unique patterns $iArraySizeFactor = 500 Global $aUnique[$iArraySizeFactor] =[0] ; Find factors for the bit value $sFactors = "|1|" For $i = Ceiling($iMax / 2) To 2 Step -1 $nDiv = $iMax / $i If IsInt($nDiv) Then $sFactors &= $nDiv & "|" EndIf Next $sFactors &= $iMax & "|" ;ConsoleWrite($sFactors & @CRLF) ; Create initial pattern of all 1s Local $aBits[$iMax + 1] For $i = 1 To $iMax $aBits[$i] = 1 Next _SavePattern($aBits) ; Start algorithm While 1 ; Find rightmost 1 For $iIndex= $iMax To 1 Step -1 If $aBits[$iIndex] = 1 Then ExitLoop Next ; Set found 1 to 0 $aBits[$iIndex] = 0 ; Fill rest of pattern with repeats of the pattern up to the found index $iFiller = 0 For $i = $iIndex + 1 To $iMax $iFiller= Mod($iFiller, $iIndex) + 1 $aBits[$i] = $aBits[$iFiller] Next ; If the found index is a factor of the bit value - valid pattern If StringInStr($sFactors, "|" & $iIndex & "|") Then _SavePattern($aBits) EndIf ; If leftmost 1 changed to 0 then pattern must be all 0s so end If $iIndex = 1 Then ExitLoop EndIf WEnd ReDim $aUnique[$aUnique[0] + 1] ConsoleWrite(TimerDiff($nBegin) & @CRLF) _ArrayDisplay($aUnique, "", "", 8) Func _SavePattern($aArray) ; Convert pattern to string $sPattern = "" For $i = 1 to UBound($aArray) - 1 $sPattern &= $aArray[$i] Next ; Resize array if required $aUnique[0] += 1 If $aUnique[0] > UBound($aUnique) - 1 Then ReDim $aUnique[UBound($aUnique) + $iArraySizeFactor] EndIf ; Add pattern to array $aUnique[$aUnique[0]] = $sPattern EndFunc And please do not ask me to explain why it works - it took me long enough to work out how to get it to run! M231 point
-
I took picture for the non-hovered button sprite and a picture of hovered button sprite. Yeah, I changed from autoit to Java.1 point
-
This UDF will be superseeded by a new UDF: OutlookEX.UDF, updated by: Water Check it out and write comments if we have designed it an a good and easy way. Updated: 2010-01-13 - All With ... EndWith removed. Updated: 2009-10-29 - _OutlookModifyAppointment() If run 2 times in a row, error: "Outlook.au3 (1534) : ==> Nested "With" statements are not allowed.:" Updated: 2009-04-17 - OutlookGetMail & OutlookSaveMail, see below Updated: 2009-03-25 - OutlokGetAppointments, returning more values Updated: 2009-03-23 - Get rid of Security Warnings when reading/modifying - http://www.mapilab.com/outlook/security/ 2009-03-12 - 5 new functions, better DemoFiles grouped in different files. A draft to an Outlook UDF, tested on Windows 2000 and Outlook 2003 ************************************************************** ***** Syntax for the functions, look in Outlook.au3 on each function ***** ************************************************************** 24 Functions so far: _OutlookSendMail - Updated 2009-02-24 - Several attachments didn't work, fixed _OutlookCreateNote _OutlookCreateTask _OutlookCreateAppointment - New 2009-02-11 _OutlookCreateContact - New 2009-02-12 ***** On the General Tab I have failed to find how to set Contacts and Private ***** _OutlookCreateDistList - New 2009-02-17 _OutlookModifyAppointment - Updated 2009-10-29 _OutlookGetAppointments - New 2009-02-24 - Get an Array of all appointments _OutlookGetMail - Updated 2009-04-17, Change read Status, access root folder, Updated 2009-03-12, Added OnlyReturnUnread, New 2009-02-26 - Get an array of all mail _OutlookSaveMail - Updated 2009-04-17, Change read Status, access root folder, New 2009-02-27 - Save a mail and it's attachments to the hard disk, The characters \/:*?"<>| which is not allowed in filenames is replaced by _ _OutlookDeleteMail - New 2009-03-02 - Delete one or more mail from a folder _OutlookGetTasks - New 2009-03-04 - Get an array of all Tasks _OutlookGetNotes - New 2009-03-04 - Get an array of all Notes _OutlookGetContacts - New 2009-03-04 - Get an array of all Contacts _OutlookDeleteNote - New 2009-03-05 - Delete a note _OutlookDeleteTask - New 2009-03-05 - Delete a task _OutlookGetDistLists - New 2009-03-05 - Get the contents of one or more distribution lists _OutlookDeleteTask - New 2009-03-06 - Delete a task _OutlookModifyTask - New 2009-03-06 - Modify a Task _OutlookDeleteDistListMember() - New 2009-03-09 - Delete a member in a distribution list _OutlookDeleteDistList() - New 2009-03-09 - Delete a distribution list _OutlookFolderExist - New 2009-03-12 - Test if a folder exist _OutlookFolderAdd - New 2009-03-12 - Add a folder _OutlookFolderDelete - New 2009-03-12 - Remove a folder _OutlookDeleteXXXX, _OutlookModifyXXXX - Functions to develop OutlookWarning.exe renamed to OutlookWarning1.exe OutlookWarningAddress.exe renamed to OutlookWarning2.exe In _OutlookSendMail there is a parameter for the entire path for OutlookWarning1.exe, it is necessary because of a security feature in Outlook so a program shouldn't be able to send a mail unnoticed. OutlookWarning1.exe automatically press the Yes-button. Compile OutlookWarning1.au3 and put it where you would like to have it. In _OutlookCreateDistList there is a parameter for the entire path for OutlookWarning2.exe, it is necessary because of a security feature in Outlook so a program shouldn't be able to modify addresses unnoticed. OutlookWarning2.exe automatically press the Yes-button. Compile OutlookWarning2.au3 and put it where you would like to have it. More features to come if the community is interested. Attached file: Outlook.zip - 7 Demo files and 3 UDF files 1557 downloads until 2010-01-13 Outlook.zip1 point