Jump to content

vicsar

Members
  • Posts

    8
  • Joined

  • Last visited

About vicsar

  • Birthday 09/04/1983

Profile Information

  • Location
    Heredia, Costa Rica
  • WWW
    http://www.about.me/vicsar

Recent Profile Visitors

166 profile views

vicsar's Achievements

Seeker

Seeker (1/7)

1

Reputation

  1. Yeah... I guessed so. I was just hopeful. I find that feature very useful but since it is not there I use DBug and output to console. Thanks BrewManNH.
  2. So... a long time has passed yet the question remains: Is there a way to step through AutoIt's code, a la VBE's (F8)? - Natively, that is. Currently I use Dbug.
  3. Thanks for your feedback Melba 23. I will PM you.
  4. Melba23, Yes you are right. It is a limited solution. I guess there is no way around proper error handling (I prefer it myself as well); however, I wanted to show Red-Steel an example I found. I mean, we must understand that sometimes we just want to run and make a simple script due to work deadline and the like. Red-Steel, Following is an example of error handling (at least it works for me); ; Activate XOnline App Opt('wintitlematchmode', 2) WinActivate("App - Agent") Sleep(500) ; Triger search Send("^f") Sleep(500) Send("@") Sleep(500) Send("{ENTER}") Sleep(500) ;Find , in Chrome, the higlighted @ sign, orange pixel $OrangePixel = PixelSearch(390, 170, 1540, 280, 0xff9632) If $OrangePixel = "AutoIt.Error" Then     ; Handling the error, if color not found     ToolTip("", "") Else     MouseMove($OrangePixel[0], $OrangePixel[1], 0) EndIf ;Find , in Chrome, the higlighted @ sign, yellow pixel $YellowPixel = PixelSearch(390, 170, 1540, 280, 0xffff00) If $YellowPixel = "AutoIt.Error" Then     ToolTip("", "") Else     MouseMove($YellowPixel[0], $YellowPixel[1], 0) EndIf Sleep(1000) ; Copy e-mail from XOnline App. Click at the current mouse position. MouseClick($MOUSE_CLICK_SECONDARY) Sleep(500) Send("e") Sleep(1000) I trust someone will find it useful at some point.
  5. SoftVoile, Red-Steel, Check this out, line 26 or so, (I know, I know, old post, but the problem is still out there for others): Source: https://github.com/ellysh/autoit-examples/blob/master/COM/ExcelFileTest.au3 #include <Constants.au3> ; Excel file Automation Example ; ; Based on AutoItCOM version 3.1.0 ; ; Beta version 06-02-2005 ; An Excel file with filename Worksheet.xls must be created in the root directory ; of the C:\ drive in order for this example to work. Local $FileName = @ScriptDir & "\Worksheet.xls" If Not FileExists($FileName) Then MsgBox($MB_SYSTEMMODAL, "Excel File Test", "Can't run this test, because you didn't create the Excel file " & $FileName) Exit EndIf Local $oExcelDoc = ObjGet($FileName) ; Get an Excel Object from an existing filename If IsObj($oExcelDoc) Then Local $String = "" ; String for displaying purposes ; Some document properties do not return a value, we will ignore those. Local $OEvent = ObjEvent("AutoIt.Error", "nothing") ; Equal to VBscript's On Error Resume Next For $Property In $oExcelDoc.BuiltinDocumentProperties ; $String = $String & $Property.Name & ":" & $Property.Value & @CRLF $String = $String & $Property.Name & ":" & @CRLF Next MsgBox($MB_SYSTEMMODAL, "Excel File Test", "The document properties of " & $FileName & " are:" & @CRLF & @CRLF & $String) $oExcelDoc.Close ; Close the Excel document Else MsgBox($MB_SYSTEMMODAL, "Excel File Test", "Error: Could not open " & $FileName & " as an Excel Object.") EndIf
  6. Melba23, actually it is your post the one that does not contribute to this forum. For those interested, based on 0mar4fendim reply, I was able to complete a tiresome task. Here is my approach: ; Triger search Send("^f") Sleep(500) Send("@") Sleep(500) Send("{ENTER}") Sleep(2000) ;Find , in Chrome, the higlighted @ sign, yellow pixel $pixel = PixelSearch(470,193, 845,248, 0xffff00) ;Copy e-mail from X-OnlineApp MouseClick($MOUSE_CLICK_SECONDARY, $pixel[0], $pixel[1], 1, 0) Sleep(500) Send("e") Sleep(1000) Thanks 0mar4fendim, that is a very creative approach. - And yes I know this is an old post; however, even today people may have the same problem.
  7. Hi, This might be useful to someone, this a full implementation; if you find it useful use it: #include <MsgBoxConstants.au3> MsgBox(64, "Easter", "You have entered the program", 30) ; Set volume to 100% (Windows actually does 2 steps increments for the volume) Local $i = 0 While $i <= 50 Send("{VOLUME_UP}", 0) $i = $i + 1 WEnd ; Sets the system wave volume to 100%. This controls the Wave volume, not the master volume control. Also, a value of Zero does not set mute status. SoundSetWaveVolume(100) ; Play one of the default sytem sounds SoundPlay(@WindowsDir & "\media\tada.wav", 1) MsgBox(64, "Easter", "The previous sound was played at 100%, the next one will be at 50%", 30) ; Set volume from 100% to 50% Local $i = 0 While $i <= 25 Send("{VOLUME_Down}", 0) $i = $i + 1 WEnd ; Sets the system wave volume to 100%. This controls the Wave volume, not the master volume control. Also, a value of Zero does not set mute status (Send("{VOLUME_MUTE}", 0) does that). SoundSetWaveVolume(100) ; Play one of the default sytem sounds SoundPlay(@WindowsDir & "\media\tada.wav", 1) MsgBox(64, "Egg", "You are leaving the program", 30)
    This is a great example of what AutoIt can do; however, it is missing documentation and the code is not properly commented. I suggest documenting it to make it more useful, especially to the beginners.
×
×
  • Create New...