Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/26/2024 in all areas

  1. Changing editor.SelectionNCaret[editor.MainSelection] = editor.SelectionNCaret[editor.MainSelection] + (currindentpos - previndentpos) To editor.SelectionNCaret[editor.MainSelection] = editor:FindColumn(line, previndent) Fixes most of the troubles, but it still doesn’t work when auto-completeing with autocomplete.au3.on.enter= set to \n Maybe I'll leave it to the professional.
    1 point
  2. Nine

    Autoit password style

    Here one approach (don't know if there is a better way) : #include <GUIConstants.au3> #include <WinAPIGdi.au3> GUICreate("Login", 200, 100) GUICtrlCreateLabel("", 10, 10, 180, 19, $SS_BLACKFRAME) GUICtrlSetState(-1, $GUI_DISABLE) Local $idInput = GUICtrlCreateInput("", 13, 11, 154, 17, $ES_PASSWORD, $WS_EX_TOOLWINDOW) Local $idEye = GUICtrlCreatePic("Hide.bmp", 167, 11, 21, 17), $bHide = True Local $iDefault = GUICtrlSendMsg($idInput, $EM_GETPASSWORDCHAR, 0, 0) GUISetState() While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $idEye $bHide = Not $bHide GUICtrlSetImage($idEye, $bHide ? "Hide.bmp": "Show.bmp") GUICtrlSendMsg($idInput, $EM_SETPASSWORDCHAR, $bHide ? $iDefault : 0, 0) _WinAPI_RedrawWindow(GUICtrlGetHandle($idInput)) EndSwitch WEnd bmp here : Eye.zip
    1 point
  3. "It is possible to take your .au3 script and compile it into a standalone executable" , ok, @Compiled = .exe !. Nope. "@Compiled" should have been named "@Tokenized" but then again, what is a token and where is the game I put the token in ? Linguistics, right ?. In any case what is useful to know is: is it an .exe or not. Hence this ( I guess somewhat silly ) posting of a function for that. ( I wake up to this now that I'm starting to look at distributing .a3x instead of .exe ) MsgBox(262144, @ScriptName, "IsSelfExecutable() = " & IsSelfExecutable() & ' - Tokenized: ' & @extended, 10) Func IsSelfExecutable() Return SetError(0, @Compiled, Int(@AutoItExe = @ScriptFullPath)) EndFunc
    1 point
  4. Nine

    AutoIt Snippets

    #include <Array.au3> ; From https://www.autoitscript.com/forum/topic/211337-_filelisttoarrayrec-but-each-subfolder-is-returned-in-separate-array-dimension/#comment-1529413 ;---------------------------------------------------------------------------------------- ; Title...........: FileListRecToMap.au3 ; Description.....: List all files from a folder recursively into a map ; : Key of map = Folder name ; : Map value = array of file names within the folder (subfolders names excluded) ; AutoIt Version..: 3.3.16.1 ; Author..........: Nine ; Date............: 2024-01-23 ;---------------------------------------------------------------------------------------- Opt("MustDeclareVars", True) Global $mList[] FileListRecToMap($mList, "C:\Apps\AutoIt\Files") For $sKey In MapKeys($mList) _ArrayDisplay($mList[$sKey], $sKey) Next Func FileListRecToMap(ByRef $mList, $sFolder, $sFileFilter = "*", $sFolderFilter = "*") Local Static $oShell = ObjCreate("Shell.Application") Local $oFolder = $oShell.NameSpace($sFolder) If Not IsObj($oFolder) Then Return 1 Local $oFolderItems = $oFolder.Items() $oFolderItems.Filter(0x40, $sFileFilter) ; SHCONTF_NONFOLDERS Local $aList[$oFolderItems.count], $i = 0 For $oFile In $oFolderItems $aList[$i] = $oFile.name $i += 1 Next $mList[$sFolder] = $aList $oFolderItems.Filter(0x20, $sFolderFilter) ; SHCONTF_FOLDERS For $oFolderItem In $oFolderItems FileListRecToMap($mList, $oFolderItem.path, $sFileFilter, $sFolderFilter) Next EndFunc ;==>FileListRecToMap
    1 point
  5. Thanks a lot @mikell This single line code saved me. After hours of failed attempts, at last, i can click on message box button. I didn't knew that we can use reg exp title inside a string this.
    1 point
  6. Study this small script: ; Open a browser with the basic example page, insert an ; event script into the head of the document that creates ; a JavaScript alert when someone clicks on the document #include <IE.au3> Local $oIE = _IE_Example("basic") _IEHeadInsertEventScript($oIE, "document", "onclick", "alert('Someone clicked the document!');") AdlibRegister('CloseAlert', 1000) $tdStart = TimerInit() While TimerDiff($tdStart) < 60000 Sleep(1000) WEnd _IEQuit($oIE) Func CloseAlert () Sleep(3000) ControlClick('[CLASS:#32770]', 'Someone clicked the document!', 2) EndFunc ;==>CloseAlert after example is shown ckick into brower document. 3 sec's later the shown alert is closed.
    1 point
  7. You might check both if class is #32770 and if the word "error" exists in the title, or the text of the button in the text, or all together WinExists("[CLASS:#32770; REGEXPTITLE:(?i)(.*error.*)]", "OK")
    1 point
  8. #include <IE.au3> $oIE = _IECreate("www.autoitscript.com") __IENavigate($oIE, "www.google.com", 0, 0x800) __IENavigate($oIE, "www.gmail.com", 0, 0x800) __IENavigate($oIE, "www.ebay.com", 0, 0x800)From
    1 point
  9. Hello arunachandu, Try the following: #include <IE.au3> $oIE = _IECreate("www.autoitscript.com") __IENavigate($oIE, "www.google.com", 0, 0x800) __IENavigate($oIE, "www.gmail.com", 0, 0x800) __IENavigate($oIE, "www.ebay.com", 0, 0x800 Please note that there are two underscores for the __IENavigate() function and that from what I can tell it is still being developed (it's an unsupported feature of AutoIt). The documentation for the function is below: ; Function Name: __IENavigate() ; Description: ** Unsupported version of _IENavigate (note second underscore in name) ; ** Last 4 parameters insufficiently tested. ; ** - Flags and Target can create new windows and new browser object - causing confusion ; ** - Postdata needs SAFEARRAY and we have no way to create one ; Directs an existing browser window to navigate to the specified URL ; Parameter(s): $o_object - Object variable of an InternetExplorer.Application, Window or Frame object ; $s_Url - URL to navigate to (e.g. "http://www.autoitscript.com") ; $f_wait - Optional: specifies whether to wait for page to load before returning ; 0 = Return immediately, not waiting for page to load ; 1 = (Default) Wait for page load to complete before returning ; $i_flags - URL to navigate to (e.g. "http://www.autoitscript.com") ; $s_target - URL to navigate to (e.g. "http://www.autoitscript.com") ; $spostdata - URL to navigate to (e.g. "http://www.autoitscript.com") ; $s_headers - URL to navigate to (e.g. "http://www.autoitscript.com") ; Requirement(s): AutoIt3 V3.2 or higher ; Return Value(s): On Success - Returns -1 ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 ($_IEStatus_Success) = No Error ; - 1 ($_IEStatus_GeneralError) = General Error ; - 3 ($_IEStatus_InvalidDataType) = Invalid Data Type ; - 4 ($_IEStatus_InvalidObjectType) = Invalid Object Type ; - 6 ($_IEStatus_LoadWaitTimeout) = Load Wait Timeout ; - 8 ($_IEStatus_AccessIsDenied) = Access Is Denied ; - 9 ($_IEStatus_ClientDisconnected) = Client Disconnected ; @Extended - Contains invalid parameter number ; Author(s): Dale Hohm ; ; http://msdn.microsoft.com/workshop/brows.../reference/enums/browsernavcon ; ; Flags: ; navOpenInNewWindow = 0x1, ; navNoHistory = 0x2, ; navNoReadFromCache = 0x4, ; navNoWriteToCache = 0x8, ; navAllowAutosearch = 0x10, ; navBrowserBar = 0x20, ; navHyperlink = 0x40, ; navEnforceRestricted = 0x80, ; navNewWindowsManaged = 0x0100, ; navUntrustedForDownload = 0x0200, ; navTrustedForActiveX = 0x0400, ; navOpenInNewTab = 0x0800, ; navOpenInBackgroundTab = 0x1000, ; navKeepWordWheelText = 0x2000 ; From what I gather, the reason for it being unsupported is that M$ doesn't want any of your IE tabs being hijacked from a naughty script running in a tab. Also I think you can use _IEAttach to navigate between the tabs (I haven't tested this). Good luck and please let me know how you get on :-)
    1 point
×
×
  • Create New...