Leaderboard
Popular Content
Showing content with the highest reputation on 01/19/2018 in all areas
-
Renaming a $var1 to $newvarname
kartune reacted to JLogan3o13 for a topic
Moved to the appropriate forum, as the DEV forum very clearly states:1 point -
Controlsend and ControlClick doesnt work
Earthshine reacted to careca for a topic
For the run button, why not this? WinActivate('Welcome') ControlClick('Welcome', '', 1)1 point -
you are only ever assigning values to variables. How are you confirming that $clear1 & "3" is even a control before you set its state? Somewhere between the creation of those controls and the setting of their state, I would declare all possible variables; and adjust the values as necessary with case statements.1 point
-
OutlookEX UDF
Earthshine reacted to UEZ for a topic
@water: the download file seems to be corrupt. Please update.1 point -
Set Drag & Drop items for your ListBox'es
Earthshine reacted to JLogan3o13 for a topic
@x_bennY do you honestly believe this is enough information for someone to help you?? How about providing your code, rather than asking us to guess?1 point -
Earthshine, Please stop acting like a teenager - carry on posting like this and you will find that you cannot post at all. M231 point
-
Version 1.3.3.0 of the UDF has been released. Please test before using in production! For download please see my signature.1 point
-
How to create embedded Youtube Video
x_bennY reacted to Earthshine for a topic
You don’t even look at the help! https://www.autoitscript.com/autoit3/docs/libfunctions/_IECreateEmbedded.htm Have fun. oh and want a cookie with that? do you need someone to read it for you?1 point -
Using the StringRegExpReplace method. Credits to AsprinJinkie and Mikell #include <File.au3> ; open the file that the results will be written to Local $h_File = FileOpen(@ScriptDir & '\done.txt', $FO_OVERWRITE + $FO_CREATEPATH) ; write the text with the duplicates removed FileWrite($h_File, _ StringRegExpReplace( _ ; start the string replacement StringRegExpReplace(FileRead(@ScriptDir & '\links.txt'), '(?msx)(?i)(^http:\/\/www\. .+$)(?= .* \1)', ''), _ ; remove the duplicate links Credit to AsprinJunkie "(?m)^\s*$\R?", "")) ; remove the blank lines credit to Mikell https://www.autoitscript.com/forum/topic/191985-how-to-delete-blank-lines-in-txt-file-with-stringregexpreplace-method/?do=findComment&comment=1377392 If using an array then use _FileWriteFromArray()1 point
-
COM error handling in a UDF - best practice?
pixelsearch reacted to water for a topic
Example: You define a global COM error handler to grab all COM errors occurring in the main script. A local COM error handler grabs all COM errors occurring inside a function. When the function ends the local COM error handler is dropped and the global COM error handler is active again. Global $oGlobalCOMErrorHandler = ObjEvent("AutoIt.Error", "_ErrFuncGlobal") ; Global COM error handler Global $oIE = ObjCreate("InternetExplorer.Application") $oIE.xyz FunctionLocal() $oIE.xyz Exit Func FunctionLocal() Local $oLocalCOMErrorHandler = ObjEvent("AutoIt.Error", "_ErrFuncLocal") ; Local COM error handler $oIE.xyz EndFunc ; Global COM error handler Func _ErrFuncGlobal($oError) ; Do anything here. ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> Global COM error handler - COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc ;==>_ErrFunc ; Local COM error handler Func _ErrFuncLocal($oError) ; Do anything here. ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> Local COM error handler - COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc ;==>_ErrFunc1 point -
Delete Multiple Directories with Wildcard
SamsonSlice reacted to Melba23 for a topic
goodmanjl531, It seems that DirRemove does not honour wildcards - it does not say that it does in the Help file and my testing confirms that. So you will have to list the folders using _FileListToArray and then remove them individually - this code works for me: #include <File.au3> $sPath = "M:\" ; Change to match your required path $aList = _FileListToArray($sPath, "slu*.tmp", 2) For $i = 1 To $aList[0] DirRemove($sPath & $aList[$i], 1) Next M231 point -
You seem to be failing to see the forest for the trees or you have failed to provide a crucial piece of information. Why do you compile the script as CUI? Why not compile it as GUI and write it correctly so that a single flag is checked before any interactive GUI's are shown? Services can be invoked with command line parameters so it is trivial to setup the service invocation with a /service flag which is processed and sets an internal flag which causes all GUI code to be skipped. No reading the PE header. No separate compilation for special circumstances, et cetera.1 point
-
Script Not working when Windows is Locked
replaygeorge reacted to MHz for a topic
The locked screen remains the active window so you need to use Win* functions and Control* functions that do not require an active window to work with. This example works with a locked Windows session. Send('#l') ; Start the locked screen Sleep(3000) Run('notepad.exe') WinWait('Untitled') ControlSend('Untitled', '', 'Edit1', 'sample text sent to an inactive window{ENTER}') MsgBox(0x40030, '', 'Script Finished') ; Unlock the screen manually now to see the result.1 point