Jump to content

AutoitMike

Active Members
  • Posts

    194
  • Joined

  • Last visited

Everything posted by AutoitMike

  1. Ok, If anyone is watching, here is how to do it. There is a function called Pixelsearch. If you can define a rectangle in which to search for a highlighted bar, you specify a color to search for within this rectangle. This color is provided in the AutioIt tool form under the "Mouse" tab with a text line labeled "Color". The function returns the coordinates where this pixel first exists. Use these values to "MoveMouse()" and violia, you found the highlighted e-mail.
  2. I need to figure out which e-mail in a web based exchange server is highlighted. Using the AutoIt tool, the "Mouse" tab shows a color value that changes to 0x316AC5 when the mouse is over an e-mail that is highlighted. (When the mouse is over this e-mail, the WinGetText has the e-mail subject line). However, WinGetText() does not provide this info. I cant seem to find any function that does. Is there a function for this or a better way? Thanks.
  3. Can someone tell me how to open an existing , File SQL database? The examples in help only show how to create / open / work with / close / query, etc, etc on a database in memory. I have a SQL lite database file already existing at a specific folder with a specific file name. The following returns error: include <sqlite.au3> $FN="c:\temp\Reports.db" $Handle=_SQLite_Open($FN) MsgBox(0,"",$Handle) This does the same thing: include <sqlite.au3> $FN="c:\temp\Reports.db" $Handle=_SQLite_Open($FN=":File:") This is what is shown in the examples, however, it does not work. (I replaced "Memory" with "File") MsgBox(0,"",$Handle) Any help would be greatly appreciated.
  4. This produces errors concerning $Doc. This variable has not been created.
  5. Is there a way to get a variable that is created within a function? In this example I get a message box with "pp", I am expecting "abc" Global $a $a="pp" Test($a) MsgBox(0,"",$a) Func Test($a) $a="abc" EndFunc Thanks
  6. Is there a way to automate sending an e-mail , with attachments to a web based MS exchange server? EG https://blablabla.com/exchange without use of the GUI? I need: A send TO: A Send BCC: A subject line (of course) Attachment file/s A body message. EG "Hey Bob, file is attached, thanks" I imagine that I might have to log in first, or maybe that can be done as well. Thanks
  7. OK, I opened the example which shows how to get the collection, which I dont need. Then I replaced the get collection with doc close. The following works: $WordApp = _WordAttach ("68997-MN.doc", "FileName") If Not @error Then $Doc = _WordDocGetCollection ($WordApp, 0) _WordDocClose ($Doc) EndIf So in order to close a document, I have to use the function $Doc = _WordDocGetCollection ($WordApp, 0) ??? It seems that there must be a cleaner way. Thanks
  8. Sorry, I cant seem to make it work. I want to close an existing document named "MYdoc.doc" using the info in the title bar which is "MYDoc.doc" I am trying the following: Shouldn't this close it ?? _WordDocClose(_WordAttach("MYdoc.doc","title")) This produces an error. C:\HouseMaster\Programs\test.au3(5,50) : ERROR: _WordDocClose() called with Const or expression on ByRef-param(s). _WordDocClose(_WordAttach("MYdoc.doc","Title")) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Program Files\AutoIt3\Include\Word.au3(594,102) : REF: definition of _WordDocClose(). Func _WordDocClose(ByRef $o_object, $i_SaveChanges = -2, $i_OriginalFormat = 2, $f_RouteDocument = 0) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\HouseMaster\Programs\test.au3 - 1 error(s), 0 warning(s)
  9. I am trying to close a Word doc that is opened by Word using _WordDocClose I don't know what to use for "ByRef $o_object" Thanks
  10. I am creating a form with multiple buttons using GUICtrlCreateButton() How do I set the focus to a particular button? Thanks
  11. Its the #include statements. It looks like they have to be at the top of the code. Not within a function. Thanks for the help.
  12. Here is the code that works by itself as a standalone script: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_outfile=C:\HouseMaster\Programs\SendDocs.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Date.au3> dim $DT ;datedim $FC ;File Count Dim $FL[10] ;file list ;Dim $CompName=EnvGet("computername") #include <File.au3> #include <Array.au3> $DT=stringreplace(_nowcalcdate(),"/","-") ;$FC=DirGetSize("C:\Documents and Settings\Mike\My Documents\My Pictures\Toolbox\"&$DT,1) ;========================================================================================== ;new code, get file names and number of files in folder. $FileList = _FileListToArray(EnvGet("USERPROFILE")&"\My Documents\My Pictures\Toolbox\"&$DT, "*.pdf", 1) Opt("MouseCoordMode", 0) ;========================================================================= ;Goto Outlook If Not WinActivate("Microsoft Outlook Web Access") Then MsgBox(0,'',"Cant find outlook") Exit EndIf For $I = 1 to $FileList[0] MouseMove(300,210,0) MouseClick("left") ;New message WinWait("Untitled -- Message") ;=========================================================== ;size the window properly $WS=WinGetClientSize("Untitled -- Message") If $WS[0] < 710 or $WS[1] < 420 Then ;MsgBox(0,"",$WS[0] & " "& $WS[1]) WinActivate("Untitled -- Message") MouseMove($WS[0],$WS[1]+20,0) MouseDown("Left") MouseMove(850,510,0) MouseUp("Left") EndIf ;================================================================ MouseMove(75,90,0) Sleep(1000) Send("[email protected]{tab}[email protected]") Send("{tab}{tab}{end}") MouseMove(50,210,0) ;For $I = 1 to $FileList[0] MouseClick("left") WinWaitActive("Attachments") While StringInStr(WinGetClassList("Attachments"),"ComboBox")< 1 ;WinActivate("Attachments") WEnd MouseMove(100,120,10) ;make 10 to slow mouse move so that text box is ready, 0 no work Sleep(2000) MouseClick("Left") Send(EnvGet("USERPROFILE")&"\My Documents\My Pictures\Toolbox\"&$DT&"\"&$FileList[$I]) ;ready to attach files MouseMove(450,166,0) MouseClick("Left") MouseMove(450,330,0) While WinExists("Attachments") MouseClick("Left") Sleep(1000) WEnd ;now put in subject line $A=StringReplace($FileList[$I]& " / ",".pdf","") MouseMove(150,225,0) MouseClick("Left") Send($A) MouseMove(30,75,0) MouseClick("Left") WinWaitClose("Untitled -- Message") Sleep(500) WinActivate("Microsoft Outlook Web Access") Next Exit ;==================================================================================================== Here is a GUI window that I created: #include <GUIConstantsEx.au3> #include <Date.au3> GUICreate("HouseMaster Automation 2", 250, 400) ;GUICtrlCreateLabel("Hello world! How are you?", 30, 10) $StopOlympus = GUICtrlCreateButton("Stop Olympus", 70, 50, 100) $SendCheckList = GUICtrlCreateButton("Send Checklists", 70, 80, 100) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $StopOlympus StopOlympus() ;this one works Case $msg = $SendCheckList Checklist() Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd ;===============Stop Olympus Camera==================================== Func StopOlympus() Opt("wintitlematchmode",2) If WinExists("Drag And File Gold") Then WinWaitClose("Drag And File Gold") EndIf RunWait("C:\Program Files\USB Safely Remove\usr.exe stop -n olympus") ;MsgBox(0,"","OK to remove") Run("C:\Program Files\Drag And File Gold\df32.exe") EndFunc ;==================E-Mail Checklist/s====================================== Func Checklist() ;If I add the code here, I get "Syntax error "Func" EndFunc Thanks
  13. I have 5 different scripts that perform different automation functions. They all work very well. I thought that putting all of them into a single window with a button for each one would be simple and easy. I created a function for the first script and it worked. I created a second button that did not point to anything. I created a new function called "EMailCL" that has no code. I ran the gui and it ran. Then I pasted the code from the script (which runs fine) in between "Func EMailCL()" and "EndFunc" and when I attempt to run the GUI I get a syntax error "Func" with a caret under the "F" of Function. There are no functions in "EMailCL" What gives???
  14. Where did you find "_FileListToArray" ? This works great !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  15. This looks fantastic, I think it will work. I am inserting this into my code now. I will let you know..........
  16. It seems that when a window is "Cold", that is, it has not had the focus for a long time, keystrokes (Send function) do not play properly. I have code that copies the names of 2 , maybe 3 files from a "My Computer" explorer window and puts them into an array. This is the window you get by clicking on "My Computor, rather than "Windows explorer") If Not WinActivate("folder name") Then MsgBox(0,'',"Proper window is not open, Exiting") Exit EndIf Sleep(500) ;Let the window have time to come fully alive, however, it does not help Dim $FL[10] ;FC is file count, previously calculated (which is an array) Send("{home}") ;This highlights the first file (In details view) ;put all file names into array For $I = 1 to $FC[1] Send("!fm") ;Rename command, this makes the currently highlighted file name editable (and copy-able to clip board) Send("^c") ;copy to clipboard Send("{enter}{down}") ;Press enter without making any changes and move down to the next file name $FL[$I]=ClipGet() ;put the file name into the array Next What I end up with is 1, 2 or 3 of the elements in the array $FL that was already in the clipboard from an other application. It Always works correctly the second time in succession. Any ideas anyone?? Thanks
  17. Can someone give me a list of the var names for the function "EnvGet". Help only provides "Path" Thanks
  18. I am attempting to automate sending an e-mail on a web based exchange server with multiple attachments (usually 2 to 3 attachments). My script gets the first file name from a "My Computer Explorer" window (I am sending all files in the selected folder) Activates the window "Microsoft Outlook Web Access" , Starts up a new e-mail, clicks the "Attachments" button after waiting for the "Untitled -- Message" window to exist. and waits for the "Attachments window to open up. It then enters the path / file name , attaches the file and closes the attachments window (It has too be closed, its the only way to know that the files is done attaching, the "Close" button is greyed out while uploading). It then goes back to the "My Computer Explorer" window , arows down to the next file and gets the file name. The very next line of code is WinActivate("Untitled -- Message"), the window exists, but it is not activated. Any help would be greatly appreciated. BTW, The "FileOpenDialog" "init dir" will not go to anything except for "Windows" , if you enter "C:\Temp" , the init directory is "Windows", even if "C:\Temp" exists. Thanks
  19. I am attempting to automate sending a number of files via Exchange that is on a web server. EG, I go to https://abc.com/exchange and log in. I am not able to detect when each file is finished "Attaching" for e-mails I send (when the file shows up in the list box). See attached WinGetText does not work, WinDetectHiddenText=1 does not change anything. Any help would be great. Thanks
×
×
  • Create New...