Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/16/2019 in all areas

  1. spudw2k

    AutoIt Use Question

    Hi Aspar, and welcome. AutoIt can most likely help automate in some way or fashion, depending on the application / process being automated. It can do very simple tasks (i.e. simulate keyboard inputs and mouse movements and clicks), or sophisticated tasks (i.e. UI control interaction and manipulation). Personally, I would recommend as a great starting point to use the AU3Info tool included with AutoIt and inspect the application. This tool identifies UI controls / classes and will help pave the way for using methods to interact with the application. A few things to consider when asking for help on the forum: 1) The more info you can share, the more we can (potentially) help--application names, screenshots and sample script code you are having issues with. We can't help by guessing what you are working with. This also leads me to my next point. 2) The members here are not free coders; meaning please don't expect to be provided an entire solution. Some of us are more or less inclined to write code for you depending on our expertise, availability and desire. We like to see people show some effort on their own, but we'll help as much as we can if or when you get stuck. 3) The help file is your friend. To quote Neo from the Matrix, "Where we go from [here] is a choice I leave to you." Once again, welcome.
    2 points
  2. Sers, while working on another project I was in need of desktop notifications. I wanted an own implementation and from time to time the code grew and I thought about sharing it with the world. I know that there is a similar UDF out there but when my project got bigger an UDF was the best choice for me. As you can see the UDF's differ in usage and style of notifications. So, what do we have? The UDF offers the usage of permanent desktop notifications for your own script in a very easy way. Notifications are starting in the bottom right corner of your main screen and will be shown on top until there is no more space. Further notifications will be shown if previous ones are closed. The notifications have a nice minimalistic design in two colors. By default they match the look of the dark taskbar in Windows 10, but colors and other things can be set differently if wished (see example scripts). The UDF works for GUIOnEventMode activated and deactivated and detects it automatically. Show me! Each notification has its GUI, a title, the message, a seperating line, date label, time label and a closing button (and if activated, a border around the notification). The color of the title, message, seperating line, date, time and closing button (+ border if activated) have all the text color. Right now notifications have a fixed size. I thought about variable sizes but did not add it because I didn't need it so far. Some people may notice the shorter seperating line when border is activated, thats just because of better looks Notifications will be colored as the following: Windows 10: they match the design of the taskbar Windows 8/8.1: On most designs: they match the border color of active windows, else they are black with transparency (see screenshot) Windows 7 and earlier: black with transparency (sry aero) How do I use notifications in my script? include UDF call _Notifications_Startup() (after you determined if you want to use GUIOnEventMode or not) If GUIOneventMode deactivated: call _Notifications_CheckGUIMsg($__GUIMsg) in your main loop create a notification using _Notifications_Create($__title, $__message) Between step 2 and 3 you can set various options: _Notifications_SetAnimationTime _Notifications_SetBorder _Notifications_SetButtonText _Notifications_SetBkColor _Notifications_SetColor _Notifications_SetDateFormat _Notifications_SetSound _Notifications_SetTextAlign _Notifications_SetTimeFormat _Notifications_SetTransparency You can also set own functions to be called when notifications are clicked (see advanced example). And now? You can find more information in the UDF. There also are two example scripts to show the usage for GUIOnEventMode activated and deactivated. Another advanced example shows the usage of the Set-Functions. Thats it? Yup, have fun. Changelog Notifications.au3 ( v1.2) Notifications GUIMsg Example.au3 Notifications OnEvent Example.au3 Notifications Advanced Example.au3
    1 point
  3. Version 2.0.0

    843 downloads

    File- and stdout/-err (console) output of messages, regular- and COM Object errors, exit method and -code, etc. More ...
    1 point
  4. File- and stdout/-err (console) output of messages, regular- and COM Object errors, exit method and -code, etc. Just call _AUERLO_Log() after to be logged functions (no parameters required if preceding function returns @error on failure). Or replace ConsoleWrite() (and SciTE trace lines) by _AUERLO_Log() for existing scripts. _AUERLO_FileRead() and _AUERLO_View() to display error log file contents (or import as CSV file to Microsoft Excel for example). Register custom functions to adjust date/time format and replace or add output functionality (no UDF source code modifications required). Output to: file console (stdout and stderr) non-blocking notification (Beep(), SoundPlay(), etc.) prompt (GUI dialog; script-halting notification) Microsoft Windows Event Log custom (register function) Download: AUERLO v2.0.0 Remarks: AutoIt v3.3.14.3+ required. @ScriptLineNumber = 0 if from callback (like $AUERLO_OPT_FUNCEXIT, except for $AUERLO_OPT_FUNCCOM = Default), -1 if @compiled. Generates Au3Stripper warnings (to be ignored without consequence; #AutoIt3Wrapper_Au3stripper_OnError=ForceUse -safe). agpl-3.0 auerlo.au3 : _AUERLO_Set() _AUERLO_Log() _AUERLO_LogAlt() _AUERLO_LogWinAPI() _AUERLO_LogEnv() _AUERLO_Assert() _AUERLO_FileClear() _AUERLO_FileRead() _AUERLO_View() auerloConstants.au3 : $AUERLO_LVL__ENUM - debug levels, $AUERLO_OPT__ENUM - _AUERLO_Set() options, $AUERLO_RET__ENUM - Return codes, $AUERLO_ERR__ENUM - @error codes, and $AUERLO_ATR__ENUM - error item attributes. Usage explanation: If @error signifies failure (implicit logging) : _ArrayDisplay($sNotAnArray); Returns @error = 1. _AUERLO_Log() ; Logs as $AUERLO_LVL_TRACE, $AUERLO_LVL_ERROR on @error, $AUERLO_LVL_DEBUG on @extended. If @error Then ... ; _AUERLO_Log() transparently passes @error and @extended from _ArrayDisplay(). If return value signifies failure (explicit logging) : If FileExists('invalid path') = 0 Then _AUERLO_Log('', $AUERLO_LVL_ERROR) Global $g_hFile = FileOpen('invalid path') If $g_hFile = -1 Then _AUERLO_Log('', $AUERLO_LVL_ERROR) If (return) value or expression result signifies failure (implicit logging): Global $g_hFile = FileOpen('invalid path') _AUERLO_Assert(Not ($g_hFile = -1)) ; $AUERLO_LVL_DEBUG if True (success), $AUERLO_LVL_WARNING if False. _AUERLO_Assert(FileWrite($g_hFile, 'data')); Successfull return value (1) evaluates to True; failure (0) to False. _AUERLO_Assert(IsArray($g_sNotAnArray)) Import error log file contents: Global $g_aArray2D = _AUERLO_FileRead(); Reads from current error log file. _AUERLO_View($g_aArray2D) Configuration ($AUERLO_OPT__ENUM in auerloConstants.au3 for description of all options) : _AUERLO_Set($AUERLO_OPT_LOGFILE, False) ; Disables output to error log file. _AUERLO_Set($AUERLO_OPT_LOGSTD, True) ; Enables output to stdout/stderr (console). _AUERLO_Set($AUERLO_OPT_FNCEXIT, Default) ; Registers default exit handler (no script exit logging without). _AUERLO_Set($AUERLO_OPT_FNCEXIT, Null) ; Deregisters default exit handler. _AUERLO_Set($AUERLO_OPT_FNCCOM, Default) ; Registers default COM Object error handler (no COM error logging without). _AUERLO_Set($AUERLO_OPT_FNCCOM, Null) ; Deregisters COM Object error handler. _AUERLO_Set($AUERLO_OPT_FNCCOM, YourFunc); Registers custom COM Object error handler YourFunc().
    1 point
  5. @creaciones, you should really open a new post rather than resurrect these old posts as AutoIt code has changed a lot since 2010. With that said here is a basic example of TextToColumns #include <Array.au3> #include <Excel.au3> #include <ExcelConstants.au3> $oExcel = _Excel_Open() $oWorkbook = _Excel_BookOpen($oExcel, @ScriptDir & "\DemoData.csv") ;~ Column A = 16/03/2019 2:30 pm $oRange1 = $oWorkbook.ActiveSheet.Range("A:A") ;~ Source Range $oRange2 = $oWorkbook.ActiveSheet.Range("C:C") ;~ Destination Range ;~ Reference: https://www.oreilly.com/library/view/programming-excel-with/0596007663/re515.html $oRange1.TextToColumns($oRange2, $xlDelimited, $xlTextQualifierDoubleQuote, True, False, False, False, True, True, "/") ;~ Results ;~ Column C = Day ;~ Column D = Month ;~ Column E = Year ;~ Column F = Time ;~ Column H = Am/Pm
    1 point
  6. Here it is using a richedit (simple way) #include <GuiRichEdit.au3> #include <GUIConstantsEx.au3> $hGUI = GUICreate("test", 650, 50, -1, 100) $hRichEdit = _GUICtrlRichEdit_Create($hGUI, "", 10, 10, 600, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _GUICtrlRichEdit_Destroy($hRichEdit) Exit EndSwitch If _GUICtrlRichEdit_IsModified($hRichEdit) Then $content = _GUICtrlRichEdit_GetText($hRichEdit) _GUICtrlRichEdit_SetModified($hRichEdit, false) Msgbox(0,"", $content) ; <<<<< do what you want with the link here _GUICtrlRichEdit_SetText($hRichEdit, "") EndIf Sleep(10) Wend
    1 point
  7. Why in the world are you trying to do this with Sends and mouse clicks? Why not just find out what shortcuts are in the folder and delete the ones you don't want?
    1 point
  8. I've yet to be blessed with the learning of Win10. Found this:
    1 point
  9. $hWnd = WinWait("[CLASS:SciTEWindow]") ControlSend($hWnd, "", "[ID:350]", "^aHELP")
    1 point
  10. Yes. You need to use the correct version as indicated by @TheDcoder. Apparently you missed the change they made a while back. The correct string is now "goog:chromeOptions".
    1 point
  11. It seems that it is indeed the case: https://sites.google.com/a/chromium.org/chromedriver/downloads The ChromeDriver's version matches the version of Chrome for which it is compatible with, so grab the same version of the driver as chrome.
    1 point
  12. @lee321987, I am not an expert in this but I don't know if you are able to do that. Please wait until a more experienced member of the community comes because I don't want to give you false information. Above, Nine said: You can only do it with a rich edit... There is probably a way, but I don't know how... Regards, Supra
    1 point
  13. This worked fine for me with both Firefox and Chrome. What version of Chrome / Chromedriver are you using?
    1 point
  14. New update just released on GH. Please let me know if you encounter any issues.
    1 point
  15. You can only do it with a rich edit...
    1 point
  16. wakillon

    SDL2 Firework

    A little try with SDL 2 Library, SDL 2 GFX and Sid music. As usual, no externals files needed. Press "Esc" for quit. SDL2_Fireworks.au3 Happy New Year 2017
    1 point
  17. Try the new AuCGI handler! (added September 22, 2007) Now, you can make your own web pages and web applications with AutoIt! And, with AuCGI, easier and better than ever before! AuCGI allows for exciting new features such as <?au3 ?> tags! Here's all you have to do to start making your own web pages in AutoIt! 1.) Download AuCGI.exe (click) and put it in C:\ (or wherever you want) 2.) Download Web.au3 (click) and put it in C:\Program Files\AutoIt3\include, or if you are using beta, C:\Program Files\AutoIt3\beta\include ABYSS WEB SERVER 3.) Download and install Abyss Web Server X1 if you haven't already from http://www.aprelium.com/ 4.) go to the Abyss Control panel (usually http://192.168.0.1:9999/ ) 5.) Click Configure next to the Default Host (or if you have ...bought... Abyss Web Server X2, next to whatever host you want to configure) 6.) Go to Scripting Parameters 7.) If you have already installed Web-Based AutoIt, click the pencil next to the AutoIt interpreter. If you are new to web-based autoit, click the Add button in the Interpreters table. 8.) Fill in the info with this...info: Interpreter: C:\AuCGI.exe (or where ever you put AuCGI.exe in step 1) Arguments: LEAVE BLANK Type: Standard If you are new to web-based autoit (didn't have it installed before), click Add under Extensions, and type auw (or ahp or whatever file extension you want to use for web-based Apps) 9.) click OK 10.) click OK again 11.) Click Restart at the top of the page 12.) you're ready! APACHE NOTE: AUCGI WITH APACHE IS UNTESTED AND MAY NOT WORK. IF YOU USE APACHE, PLEASE TEST THIS AND TELL ME HOW IT WORKS OUT. 3.) Add the following text to either your apache config file, or your .htaccess file (or create a .htaccess file and put this in there) Options +ExecCGI AddHandler cgi-script .auwIf you want, replace .auw with .ahp or whatever file extension you want to use for web-based Apps. 4.) I think that's it. Now, whenever you want to make a web-based App, put this at the beginning: #!C:\AuCGI.exeif you put AuCGI.exe somewhere other than C:\, put the path to there after the #! This is called a Shebang line. Yes, this has to go at the VERY beginning of the web-based app. it has to be on the very first line. No blank lines or spaces or tabs or anything before it. Even before the ##WebApp line (which you'll learn about later...) ------------------------------------------------------------------- To make your first web-based app! On the first line needs to be this: ##WebApp This marks your scripts as a web-based app. Without that there, your script will not work. If you wish, you can add parameters after that. For example: ##WebApp title="My Cool Web Page" if you specify a title, the starting html tags are there for you. If you want to put other info in the <head> tag or anything, you should set the title manually using the <title> tag, instead of using the ##WebApp line. As with the Shebang line, this must go at the very top of the script, with no blank lines or spaces before it. However, if you are using Apache, this should go after the Shebang line. you can also use ##WebApp content-type="xxxx" to change the content type that is sent to the server. The default is text/html. You could also use text/plain or pretty much any standard format content type. or you can use both: ##WebApp title="My Title" content-type="blah/blah" But I don't see why you would do that, seeing as changing the content type will make the title not work anyway... Note: Don't put double quotes in your title. Double quotes should be used to surround the title, but they should not be inside the title. Also, don't even try using variables. It won't work. Here is an example of what NOT TO DO: ##WebApp title="My name is " & $name & "! How are you?"I'm not sure why you would need a title like that anyway, but it won't work. it will just cut off at My name is. Next, you can use html or text or whatever you want. Or, you can start using AutoIt. everything between <?au3 and ?> is considered AutoIt, and anything outside it is considered html (or plain text or whatever if you changed the content typo) You can use whatever autoit you want inside the <?au3 ?> tags, and whatever html you want outside them. Note that I will eventually release a version of AuCGI that lets you block certain commands. Note: For people who have used Web-based AutoIt before, you no longer need to use _StartWebApp. That is done for you automatically when you use the #WebApp line. Note: You do not need to include Web.au3. this is done for you AUTOMATICALLY. You can use any functions in Web.au3, but you do not need to include it. I guess you can if you really want, but it won't make any difference... That's about it. If you have not used web-based autoit before, sorry, I don't have the instructions on how to use all the functions. I will type up a formal help file soon. If you have used web-based autoit before, it's exactly the same functions as before. Just use autoit inside <?au3 ?> tags and html outside. HOWEVER, _Post doesn't work. I don't think. So, don't even try. Or you can try and see if you can get it to work, but I couldn't. If you want it, here is the source to AuCGI.exe (click).
    1 point
  18. Commands cannot be sent to the UAC prompt from a process ran in user space as the UAC prompt is opened on a separate desktop instance ("Secure Desktop") which cannot be automated from a process started on the normal desktop. This ofcourse is for security purposes. What you can do is disable the Secure Desktop security, that will probably help (though I have not tested or researched). Lowering the UAC security to bypass the Secure Desktop is only useful if you have to run the script many times on the same machine for testing purposes and don't want to click the UAC every time. But when you run the script on any other machine, you will still have to click through the UAC manually (or manually disable the Secure Desktop on all machines, but that defeats the purpose ). In Windows 7+ you can do this through secpol.msc (if you have windows pro or better). Obviously you would need administrator access for that as well, so it cannot be done from your script (don't waste your time - won't work). See https://support.microsoft.com/kb/975788/en-us for more information. NOTE: Doing this of course leaves your system highly vulnerable! Take the necessary precautions (backups, restore points, disconnect network, whatever). Ideally, test in a clean virtual machine.
    1 point
  19. orbs

    Script not working for UAC

    Celtic88, i believe you may be a bit overzealous here. the OP intent may well be legitimate; the thing the OP needs to be aware of is that this forum will not provide any assistance for bypassing security measures. that said, all the OP needs to do is to acknowledge the UAC - and make the process easier by having the #RequireAdmin directive in his script. other alternatives - which are better suited for mass deployment - are to use existing deployment services, like the Windows Installer, GPO, remote execution by domain admin, etc. finally, there are plenty of forum topics about UAC the OP can learn from - although they will not help much when it comes to sporadic installation.
    1 point
×
×
  • Create New...