Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/01/2018 in all areas

  1. water

    Active Directory UDF (II)

    As the Active Directory UDF thread has grown too big, I start a new one. The original thread can be found here.
    1 point
  2. Jos

    Trouble with FileExists

    Can we all take a step back here! FileExists() works fine with spaces in the path and or filename: $file = "C:\Program Files (x86)\AutoIt3\Extras\Editors\TextPad\Manual Install and Notes.htm" ConsoleWrite('FileExists(' & $file & ') = ' & FileExists($file) & @CRLF) ;### Debug Console So it is now your turn to provide a scriptlet that shows it doesn't. Jos
    1 point
  3. Sure, just submit your updated UDF's in a Trac tiicket as a feature/update proposal. Jos
    1 point
  4. Here are some examples of proper quotes for each function call. $exist = FileExists('"C:\file path changed to protect the innocent\' & $copy & '.pdf"') $exist = FileExists('"C:\file path changed to protect the innocent\' & $copy & '.ods"') Adam
    1 point
  5. Maybe something like the following? You could also check for any processes with a suspended state (WIn 10). #include <Array.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Local $hWindow, $vWinStyle, $aWinNormal[1][2] Local $aWinList = WinList("[REGEXPTITLE:(?i)(.+)]") For $i = $aWinList[0][0] To 1 Step - 1 If $aWinList[$i][0] = "" Then ContinueLoop $hWindow = WinGetHandle($aWinList[$i][1], "") If Not $hWindow Then ContinueLoop $vWinStyle = _WinAPI_GetWindowLong($hWindow, $GWL_STYLE) If BitAND(WinGetState($aWinList[$i][1]), 4) = 4 _ And BitAND($vWinStyle, $WS_VISIBLE) = $WS_VISIBLE _ And BitAND($vWinStyle, $WS_MINIMIZE) <> $WS_MINIMIZE _ And BitAND($vWinStyle, $WS_MINIMIZEBOX) = $WS_MINIMIZEBOX _ And BitAND($vWinStyle, $WS_MAXIMIZEBOX) = $WS_MAXIMIZEBOX Then _ArrayAdd($aWinNormal, $aWinList[$i][0] & "|" & $aWinList[$i][1]) Next $aWinNormal[0][0] = UBound($aWinNormal) - 1 _ArrayDisplay($aWinNormal)
    1 point
  6. if you are testing the UI for uploading a file, then follow the advice on the post above. but if the upload is just means to an end, and the important part is not the UI but getting the file uploaded, then use AutoIt to directly upload the file to the target location (or even Windows' built-in ftp.exe utility instead).
    1 point
  7. Good. You are using all the proper functions for working with a window in session 0. Do you know exactly which line is failing? Next step would be to add logging of returns for each step. Another option is to force the selenium scripts to run on a user session with a desktop active. This works if you don't have security concerns with leaving a VM that won't logout. You can do this with PAExec or a scheduled task.
    1 point
  8. orbs

    Updates for my script

    what you ask for is very easy to do. first: host the updated version in a publicly available web site. if you have your own site dedicated to your program, that's best. otherwise you can use for example SourceForge to host your program files. there are many alternatives. if your program is running in an enterprise environment (i.e. no direct internet connection) then use an intranet site in a similar fashion. next - once you have uploaded a new version, tested the download and the upgrade routine, and you are happy - update your webpage with the new version number (in a predetermined and fixed location). for example, the web page has the text: "latest version: 1.15.38.4011" in your program, introduce a "check for updates" feature. you can implement it silently when the program starts, or have a button for the user to click on when they wish to check for updates manually. use the internal function InetRead() to read the html content of the web page. use some string manipulation to isolate the latest version number that appears there, and compare it to the running program version number. that was a rather long explanation to something that is actually quite straight forward. try it and feel free to ask if you encounter any issues.
    1 point
  9. Have you tried RunWait(@ComSpec & " /C CLS", "", @SW_HIDE)
    1 point
  10. ripdad

    WSA_NBTCP v1.00 UDF

    It should not be difficult to switch over -- and should be fairly transparent. As for "asserting the benefits", there are several. I'll list a few the native functions don't have... 1. _WSA_TCPRecv() -- BytesReceived in @extended, the Timeout Feature, and at the moment, proper error returns. 2. _WSA_TCPSend() -- BytesSent in @extended and the Select Timeout, which you can adjust. 3. The UDF can be tweaked how you want - because the source code is available to you for instant access. And you're welcome. Glad to help whenever I can.
    1 point
  11. I have no issue, using low-level reading techniques, it is just understanding the file structure itself. Adding ODBC commands also requires time investigation into the SQL language used by BDE and you need to have the BDE distribution kit installed and configured as well. I don' t see much time-difference in going either through that hoop or simply following some binary file structure. With the latter solution i'm forever independant of the sluggish BDE distribution kit (which in addition also comes packed with a lot of legal mambo jumbo issues).
    1 point
  12. Quite large? Seriously? Such a file would be 3,940,649,673,949,170 bytes long, circa 3.5 Pb (Petabytes).
    1 point
  13. Maybe something like below will give you better results: #include <Array.au3> #include <File.au3> Local $sError = "" Local $aFileList = _FileListToArrayRec("C:\Users", "TileDataLayer||Default", $FLTAR_FOLDERS + $FLTAR_NOHIDDEN + $FLTAR_NOSYSTEM, $FLTAR_RECUR, $FLTAR_FASTSORT, $FLTAR_FULLPATH) Switch @error Case 1 $sError = " - Path not found or invalid" Case 2 $sError = " - Invalid Include parameter" Case 3 $sError = " - Invalid Exclude parameter" Case 4 $sError = " - Invalid Exclude_Folders parameter" Case 5 $sError = " - Invalid $iReturn parameter" Case 6 $sError = " - Invalid $iRecur parameter" Case 7 $sError = " - Invalid $iSort parameter" Case 8 $sError = " - Invalid $iReturnPath parameter" Case 9 $sError = " - No files/folders found" EndSwitch If $sError <> "" Then MsgBox(32, "Error", $sError) _ArrayDisplay($aFileList)
    1 point
  14. water

    ExcelChart

    Version 0.4.0.1

    1,465 downloads

    Extensive library to control and manipulate Microsoft Excel charts. Written by GreenCan and water. Theads: General Help & Support - Example Scripts BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort KNOWN BUGS (last changed: 2017-07-21) None. The COM error handling related bugs have been fixed.
    1 point
  15. Okay, this is exciting. I'm proud to introduce CompileIt - an experimental compiler, that allows to compile AutoIt to machine code. ...Kind of. CompileIt does compilation in a similar way the Glasgow Haskell compiler does: translates the code into a lower-level language (in CompileIt's case it's C), and then compiles the code in that language. Now, this project is still in its infancy, since, although it is simple to use, AutoIt is incredibly complex on the inside (automation, COM, etc.). So, CompileIt can compile only a very small subset of what we know as AutoIt. Here's a list of things CompileIt (partially) supports (or not): Numbers, booleans, strings Some built-in functions If, For and While statements Exporting DLL functions (you can now write DLL's in AutoIt, guys!) No arrays, automation, GUI or COM. A more detailed list is included with CompileIt. CompileIt is written in AutoIt (the compiler interface), JavaScript (parser, executed with ChakraCore), and of course C. GCC is required to compile scripts. After you extract the files, run CompileIt.exe and configure it to work with GCC.
    1 point
  16. mikell

    Read XML Values

    You might try this $oInfos = $oXML.SelectNodes("solar/solardata/calculatedconditions/band"); ..and here is the problem $test = "" For $oInfo In $oInfos ;$oAttrs = $oInfo.attributes ;$test &= $oAttrs(0).value &" ("& $oAttrs(1).value & "): " & $oInfo.text & @crlf $test &= $oInfo.getattribute("name") &" ("& $oInfo.getattribute("time") & "): " & $oInfo.text & @crlf Next msgbox(0,"test", $test)
    1 point
  17. jdelaney

    XML - double nodes

    Meh, I was bored...example: Local $oXML = ObjCreate("Microsoft.XMLDOM") $oXML.loadxml("<gemagvl />") $oRoot = $oXML.selectSingleNode("//gemagvl") AddXML($oXML,$oRoot) AddXML($oXML,$oRoot) AddXML($oXML,$oRoot) AddXML($oXML,$oRoot) AddXML($oXML,$oRoot) AddXML($oXML,$oRoot) ConsoleWrite($oXML.xml & @CRLF) Exit Func AddXML($oXML,$o) Local $i = $o.selectNodes("./row").length + 1 Local $oChild = $oXML.createElement("row") $oChild.SetAttribute("count",$i) Local $oChild_1 = $oXML.createElement("blah") Local $oChild_2 = $oXML.createElement("blah2") Local $oChild_3 = $oXML.createElement("blah3") Local $oChild_4 = $oXML.createElement("blah4") $oChild_1.text = $i & 1 $oChild_2.text = $i & 2 $oChild_3.text = $i & 3 $oChild_4.text = $i & 4 $oChild.appendChild($oChild_1) $oChild.appendChild($oChild_2) $oChild.appendChild($oChild_3) $oChild.appendChild($oChild_4) $o.appendChild($oChild) EndFunc
    1 point
  18. water

    Active Directory UDF

    I have converted and extended the adfunctions.au3 written by Jonathan Clelland to a full AutoIt UDF including help file, examples, ScITE integration etc. The example scripts should run fine without changes. 2016-08-18: Version: 1.4.6.0 As always: Please test before using in production! KNOWN BUGS: (Last changed: ) None AD 1.4.6.0.zip For AutoIt >= 3.3.12.0 AD 1.4.0.0.zip other versions of AutoIt
    1 point
  19. jdelaney

    Read XML Values

    Example: ;~ Create the temp xml #include <File.au3> _FileCreate("Temp") FileWrite("Temp","<Data><Values><Info>Information value 1</Info><Info>Information value 2</Info></Values><Other>Other information</Other></Data>") Local $oXML = ObjCreate("Microsoft.XMLDOM") $oXML.load("Temp") $oOther = $oXML.SelectSingleNode("//Data/Other") ; or //Other ConsoleWrite("$oOther.text=[" & $oOther.text & "]" & @CRLF) $oInfos = $oXML.SelectNodes("//Data/Values/Info") ; or //Info or //Data//Info or //Values/Info For $oInfo In $oInfos ConsoleWrite("$oInfo.text=[" & $oInfo.text & "]" & @CRLF) Nextoutputs: $oOther.text=[Other information] $oInfo.text=[Information value 1] $oInfo.text=[Information value 2]
    1 point
  20. Finally I was able to solve this! I'm really excited! So here's what I found: according to Microsoft's System Wake-up Events, "When the system wakes automatically, the display is not automatically turned on." I was able to figure out how to get the screen on after a resume. The function below will do it. #cs ********************************************************************************************************* Function Name: _Monitor_ON Author: apstanto Description: Turns the monitor on after a System Wake-up Event and broadcast of PBT_APMRESUMEAUTOMATIC Input: None Return: Success: @error = 0. Failure: set @error @error: 1 unable to use the DLL file, 2 unknown "return type", 3 "function" not found in the DLL file, 4 bad number of parameters. #ce ********************************************************************************************************* Func _Monitor_ON() $ES_DISPLAY_REQUIRED = 2 DllCall("Kernel32.dll", "long", "SetThreadExecutionState", "long", $ES_DISPLAY_REQUIRED) EndFunc I hope this works for you too!
    1 point
×
×
  • Create New...