Jump to content

RodT

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by RodT

  1. You can use FileFindFirstFile to create your list of files, and GUICtrlCreateList to view it. Does that help?
  2. OK, starting with your example header: "Some Company Cool Report Page 1" ... $data = FileReadLine($infile) If StringRegExp($data, "^Some Company Cool Report Page \d+") Then ; close file for previous page, and start file for this page Else FileWriteLine($curr_outfile, $data) EndIf The "^" at the beginning of the regular expression anchors the match to the beginning of the text line. The "\d+" at the end of the regular expression matches a sequence of one or more digits. That makes the search work for "Page 3" and for "Page 123". Hope that helps!
  3. One way I do it is to create a status field in my window, and update that status field as the program cycles through its various activities. Another is to put a MsgBox in your code. If it pops up, you know you got at least that far. Hope that helps!
  4. I don't know that printable documentation exists. The documentation is so extensive, however, that you wouldn't want to print it. I have found that the help file is really all I need. The documentation there is excellent, and it's full of examples.
  5. Can I write a function which creates and returns an array, without the array going out of scope when the function returns? It would look something like this: Func GetDBRecord(ByRef $con) Local $rec[3] Local $rs = ObjCreate("ADODB.Recordset") $rs.Open("select * from table", $conn) $rs.MoveFirst() $rec[0] = $rs.Fields(0).Value $rec[1] = $rs.Fields(1).Value $rec[2] = $rs.Fields(2).Value Return $rec EndFunc $myrec = GetDBRecord($con) Would $myrec be valid and still in scope? Thanks!
  6. Try something like this: CODEWhile 1 $msg = GUIGetMsg() If $msg = $installprograms Then Run ("Progam Load.exe", "C:\Documents and Settings\Admin\Desktop\") EndIf If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd
  7. This script is my first attempt at accessing Outlook from AutoIt, based on MS documentation and examples found here. It dies at the line marked in the code (without reaching the "If @error ..." just below). What I'm attempting to do here is to list all the top-level folders. CODE$otl = ObjCreate("Outlook.Application") If @error Then Die("Cannot create application object") $nms = $otl.GetNameSpace("MAPI") If @error Then Die("Cannot access namespace object") $fds = $nms.Folders If @error Then Die("Cannot access folders object") $i = 0 Dim $fname[100] $fld = $fds.GetFirst If @error Then Die("Cannot access folders.GetFirst method") $fname[$i] = $fld.Name ;<-----------------------------------------Program fails HERE If @error Then Die("Cannot access folder name property") $i += 1 While 1 $fld = $fds.GetNext If @error Then ExitLoop $fname[$i] = $fld.Name $i += 1 WEnd $fld = 0 $fds = 0 $nms = 0 $otl = 0 $msg = $fname[0] $j = 1 While $j < $i $msg &= (@CRLF & $fname[$j]) $j += 1 WEnd MsgBox(0, "Results", $msg) Func Die($pmsg) MsgBox(0, "Error", $pmsg) Exit EndFunc Here are the messages output from AutoIt when I run it: CODE>Running:(3.2.10.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\...\Outlook_test1.au3" C:\Documents and Settings\...\Outlook_test1.au3 (22) : ==> The requested action with this object has failed.: $fname[$i] = $fld.Name $fname[$i] = $fld.Name^ ERROR ->10:15:22 AutoIT3.exe ended.rc:1 +>10:15:23 AutoIt3Wrapper Finished >Exit code: 1 Time: 1.303 Thanks for your help!!!!!
  8. I don't think you can put a picture into the clipboard using AutoIt. However, _ScreenCapture_Capture puts the image into a file. You can simply create a picture object (GUICtrlCreatePic) referencing the same file to display it in another GUI.
  9. Would you care to explain your question in a bit more detail?
  10. There's a couple of things I think you need to take a look at. First, you'll want to start the program by minimizing your own window (your running script), and finding then activating the Firefox window. Check out the functions in the "Windows Management" section of the help file for the functions you'll need. Activating the Firefox window will ensure that the keystrokes you're sending go to the correct window. Second, your keystroke sending is all in a function you've named Start(), but I'm not seeing where Start() is being called. Your application is one in which doing something is the primary activity, and responding to the GUI is secondary. That fits the "GUI OnEvent Mode". Read the "GUI Concepts" section of the help file. It explains the two modes available, and where each one is more appropriate to use. I hope this helps!
  11. I think that, to do what you want, you would have to subclass the input control. However, I don't know if that can be done with AutoIt. How about it, GUI gurus? Can an AutoIt input control be subclassed?
  12. At the end of your CalcButton and ClearButton functions, add "GUICtrlSetState($monthly, $GUI_FOCUS)". Also, just before that, in ClearButton, you may want to add "GUICtrlSetData($monthly, "")". That will clear the control.
  13. I have a SQLite query which consistently causes AutoIt to crash. The Windows (Vista) message which is displayed is "AutoIt v3 Script has stopped working". The message displayed in the log panel by AutoIt is "!>22:31:17 AutoIT3.exe ended.rc:-1073741819". If I take one column, a text column, out of the query, it works with no problems at all. If I put that column back into the query, it fails consistently. It is a text-type column. MOST of the fields in the query are of the same type; I cannot see anything different about this column. THIS query works, no problems at all: $qTxt = "SELECT LastName, FirstName, Phone, Email, Address, City, State" $qTxt &= ", Zip, Note, Attends, List, Prior, LastSvc, Active" ;, InactReason" $qTxt &= " FROM volunteers WHERE Sysid = " & String($iSysId) & ";" THIS query fails every time: $qTxt = "SELECT LastName, FirstName, Phone, Email, Address, City, State" $qTxt &= ", Zip, Note, Attends, List, Prior, LastSvc, Active, InactReason" $qTxt &= " FROM volunteers WHERE Sysid = " & String($iSysId) & ";" The only difference is the inclusion of "InactReason" as the last column in the query. It is a text column, defined just the same way as LastName, FirstName, etc. Can anyone suggest what I should be looking for? I'm stumped!!! THANKS!!!!
×
×
  • Create New...