Jump to content

ice1000

Active Members
  • Posts

    22
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

ice1000's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Yup, that did it. Thanks for the help!
  2. My code used to work ok until this latest wordpress update. The latest version has the Log out link in a ul inside a div. I can get my script to simulate a click on the div but after that I can't figure out how to click on the Log Out link. Any ideas? Here is the WP HTML: <div id="user_info_links_wrap"> <div id="user_info_links"> <ul> <li> <a title="Edit your profile" href="profile.php">Your Profile</a> </li> <li> <a title="Log Out" href="http://mysite.com/wp-login.php?action=logout&_wpnonce=f93479b1b">Log Out</a> </li> </ul> </div> </div> Here is my code. The loop looking at the inner text used to work but does not work now. The first two lines do work and open up the div. ;Logout $oLinks = _IEGetObjById($oIE, 'user_info_links'); _IEAction($oLinks,"click") ;Find and click text link $oLinks = _IELinkGetCollection($oIE) For $oLink in $oLinks $sLinkText = _IEPropertyGet($oLink, "innerText") If StringInStr($sLinkText, "Log Out") Then _IEAction($oLink, "click") ExitLoop EndIf Next
  3. Doh! Sorry about that. It just figures, I think I solved it. As soon as I simplified the path to the file, the code seems to work.
  4. I have a pretty basic script that connects to an FTP server, uploads two files to the server and then closes the connection. It works fine when I press F5 or select run script from Windows Explorer. When I compile the script to an exe and try running it that format, it doesn't run correctly. Sometimes it does not upload the files, sometimes it does. Running the au3 file is stable and always works. Any idea what could be causing this?
  5. That looks like it is what I need but I can't get it to work. #include <IE.au3> #include <Excel.au3> $oIE = _IEAttach ("Bodybuilding.com") $oExcel = _ExcelBookAttach("Data.xlsx", "FileName") $oTable = _IEGetObjByName ($oIE, "label_outer_table") ;Correctly writes to cell ;_ExcelWriteCell($oExcel, "If you can read this, then Success!", 1, 1) ;Does not work ;_ExcelWriteCell($oExcel, $otable, 1, 1) _ExcelWriteArray($oExcel, 1, 1, $oTable, 1 ) Nothing appears in Excel.
  6. I'm having trouble getting code that pastes an HTML table into Excel. I can use the _ExcelWriteCell function to write to Excel but I can't figure out how to get the HTML table to paste into Excel. I also tried putting the HTML table into the clipboard and pasting but that didn't work either. Any ideas? Here's what I have so far: #include <IE.au3> #include <Excel.au3> #include <ClipBoard.au3> $oIE = _IEAttach ("Bodybuilding.com") $oExcel = _ExcelBookAttach("Data.xlsx", "FileName") $oTable = _IEGetObjByName ($oIE, "label_outer_table") ;Correctly writes to cell ;_ExcelWriteCell($oExcel, "If you can read this, then Success!", 1, 1) ;Does not work _ExcelWriteCell($oExcel, $otable, 1, 1)
  7. I just installed AutoIt and SciTe on my Windows 7 x64 machine. I created a sample script from the help file and I can run it with no problem from windows explorer. However, in SciTe, if I use the trace or debug commands I get a 'The system cannot find the file specified.' error. I also installed the graphical debugger that is offered in this forum. When I try to debug there, the application simply crashes. Can anyone help me figure out how to get one of these working so I can step through code? Thanks!
  8. I'm having a hard time figuring this out. I have a simple web page with vbscript and 1 button. When the user clicks the button, I want vbscript to launch Autoit. I keep getting an IE error telling me it can't open the file. I think it has to do with the spaces in the path. I tried to escape the quotations but it did not work. Here's what I have so far in vb script: Set WshShell = CreateObject("WScript.Shell") Sub RunCode WshShell.Run("C:\Progra~1\AutoIt3\AutoIt3.exe C:\Documents and Settings\User\My Documents\Clients\Scripts\GetValue.au3") End Sub I also tried: WshShell.Run("C:\Progra~1\AutoIt3\AutoIt3.exe C:\Docume~1\User\My~1\Clients\Scripts\GetValue.au3") but it didn't work. What am I doing wrong?
  9. I have a script that creates an Excel object with objCreate, runs a macro, saves & closes the Excel object. I don't want the new Excel object to be visible but I need to send a few keystrokes to the hidden Excel object. How do I do that? When the code is completed I want to compile it to exe. When executed via a command line, I need a parameter (the workbook path) to be sent to the exe. Is this possible?
  10. I was trying ot avoid a reboot but that fixed things.
  11. Ahhh that was a line left over as I was trying to get the substring title match mode to work with _IEAttach. I'm just right clicking on the script and choosing 'Run Script'.
  12. My script was working perfectly until today. Now I get the following error: C:\Program Files\AutoIt3\Include\IE.au3 (3018) : ==> The requested action with this object has failed.: Return HWnd($o_object.HWnd()) Return HWnd($o_object.HWnd()^ ERROR I'm trying to get the handle of the IE window that is open. The relevant code is below. There is no other IE process running, just the one visible instance. Any ideas? #include <IE.au3> Opt("WinTitleMatchMode", 4) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase AutoItSetOption("WinTitleMatchMode",2) Dim $hIEWin = WinGetHandle("Internet Explorer") If @error Then Msgbox(0,"Error","Intnernet Explorer not open.") Exit EndIf Dim $oIE =_IEAttach($hIEWin, "HWND")
  13. That is great! WinGetHandle...never knew about that. Thanks for the help!
  14. I can't get _IEAttach to match a title based on a substring. It only works if the substring is at the beginning of the window title. I tried the solution in a thread by MiMac but I still can't get it to work. Opt("WinTitleMatchMode", 4) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase AutoItSetOption("WinTitleMatchMode",2) #include <IE.au3> $oIE=_IEAttach("Internet", "WindowTitle") I want the code to be able to find any instance of IE open. Since IE has the word Internet in the Title, I thought it would attach but I get an $_IEStatus_NoMatch error. I'm using AutoIt v3.2.8.1
  15. OK, here's my next puzzle. Thanks to all who have helped so far. AutoIt is a very powerful tool! In this particular web page I have a grid control that users can enter data into certain cells. My goal is to loop through the cells in a column & get the formula from the cell. Let's say Column A has the account and column B has the formula. I have managed to get the formula since it is also shown in another text box control. However, from this selected cell, I also need the data in the first column from it's row. How do I do this? Any pointers would be greatly appreciated. Here's the code for the grid object. <OBJECT class=grid id=GridObject style="VISIBILITY: visible; WIDTH: 886px; HEIGHT: 171px" codeBase=assets/itGrid6.cab#version=2,0,0,2 align=baseline border=0 classid=clsid:976FFD05-FBA6-44EA-8C41-A4F0FD453395><PARAM NAME="_ExtentX" VALUE="23442"><PARAM NAME="_ExtentY" VALUE="4524"><PARAM NAME="AllowBigSelection" VALUE="0"><PARAM NAME="AllowExtendedSelection" VALUE="-1"><PARAM NAME="AllowUserMove" VALUE="0"><PARAM NAME="AllowUserResize" VALUE="-1"><PARAM NAME="Appearance" VALUE="0"><PARAM NAME="AutoResize" VALUE="0"><PARAM NAME="AutoResizeMethod" VALUE="0"><PARAM NAME="AutoUpdateRows" VALUE="-1"><PARAM NAME="BackColor" VALUE="-2147483643"><PARAM NAME="BackColorAlt" VALUE="16777215"><PARAM NAME="BackColorBkg" VALUE="16777215"><PARAM NAME="BackColorFixed" VALUE="6852238"><PARAM NAME="BackColorHighlightAlways" VALUE="-2147483635"><PARAM NAME="BackColorSel" VALUE="-2147483635"><PARAM NAME="BorderStyle" VALUE="0"><PARAM NAME="Cols" VALUE="38"><PARAM NAME="DefaultColWidth" VALUE="64"><PARAM NAME="Editable" VALUE="-1"><PARAM NAME="Enabled" VALUE="-1"><PARAM NAME="ExplorerBar" VALUE="0"><PARAM NAME="ExtendLastCol" VALUE="0"><PARAM NAME="FixedCols" VALUE="1"><PARAM NAME="FixedRows" VALUE="3"><PARAM NAME="FocusRect" VALUE="3"><PARAM NAME="FocusEntireRow" VALUE="0"><PARAM NAME="ForeColor" VALUE="-2147483640"><PARAM NAME="ForeColorFixed" VALUE="16777215"><PARAM NAME="ForeColorHighlightAlways" VALUE="-2147483634"><PARAM NAME="ForeColorSel" VALUE="16777215"><PARAM NAME="FormatString" VALUE=""><PARAM NAME="FrozenCols" VALUE="0"><PARAM NAME="FrozenLine" VALUE="-1"><PARAM NAME="FrozenLineColor" VALUE="-2147483632"><PARAM NAME="GridColor" VALUE="-2147483633"><PARAM NAME="GridColorFixed" VALUE="-2147483632"><PARAM NAME="GridLines" VALUE="0"><PARAM NAME="GridLinesFixedCols" VALUE="3"><PARAM NAME="GridLinesFixedRows" VALUE="3"><PARAM NAME="HighlightAlways" VALUE="-1"><PARAM NAME="HighlightFocus" VALUE="0"><PARAM NAME="MergeCells" VALUE="0"><PARAM NAME="MousePointer" VALUE="0"><PARAM NAME="OLEDropMode" VALUE="0"><PARAM NAME="OutlineCol" VALUE="0"><PARAM NAME="OutlineStyle" VALUE="1"><PARAM NAME="ReadAhead" VALUE="1"><PARAM NAME="Redraw" VALUE="-1"><PARAM NAME="RightToLeft" VALUE="0"><PARAM NAME="RowHeight" VALUE="-1"><PARAM NAME="Rows" VALUE="8"><PARAM NAME="ScaleMode" VALUE="3"><PARAM NAME="ScrollBars" VALUE="3"><PARAM NAME="ScrollTrack" VALUE="-1"><PARAM NAME="SelectionMode" VALUE="0"><PARAM NAME="SheetBorder" VALUE="-2147483642"><PARAM NAME="NodeRowPosition" VALUE="0"><PARAM NAME="TabBehavior" VALUE="1"><PARAM NAME="TreeColor" VALUE="0"><PARAM NAME="Themed" VALUE="0"></OBJECT>
×
×
  • Create New...