Jump to content

Spiderman7

Members
  • Posts

    7
  • Joined

  • Last visited

Spiderman7's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Will do. Thanks.
  2. Wow - relax!! I am new to this forum. What does double post mean?? I will try to read the forum rules...
  3. I got it working!! Auto IT is very cool!! CODE#include <ExcelCOM_UDF.au3> Local $oExcel = _ExcelBookNew() ;Create new book, make it visible For $i = 1 To 10 ;Loop $Init = TimerInit() Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) Run('notepad.exe') WinWait("Untitled - Notepad","") If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","") WinWaitActive("Untitled - Notepad","") Send("hello{ENTER}{ENTER}{ENTER}this{SPACE}{ENTER}{ENTER}is{ENTER}{ENTER}a{SPACE}{SPACE}test{ENTER}{E NTER}{ALTDOWN}e{ALTUP}f") WinWait("Find","") If Not WinActive("Find","") Then WinActivate("Find","") WinWaitActive("Find","") Send("c") MouseMove(339,80) MouseDown("left") MouseUp("left") WinWait("Untitled - Notepad","") If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","") WinWaitActive("Untitled - Notepad","") Send("{ALTDOWN}f{ALTUP}x") WinWait("Notepad","") If Not WinActive("Notepad","") Then WinActivate("Notepad","") WinWaitActive("Notepad","") Send("n") Sleep(2000);2 seconds $Seconds = Round(TimerDiff($Init)/1000, 2) ;MsgBox(0, "Time", $Seconds) _ExcelWriteCell($oExcel, $Seconds, $i, 1) ;Write to the Cell Next MsgBox (0, "Exiting", "Press OK to Save File and Exit") _ExcelBookSaveAs($oExcel, "C:\Temp.xls", "xls", 0, 1) ; Now we save it into the temp directory; overwrite existing file if necessary _ExcelBookClose($oExcel) ; And finally we close out
  4. I am now able to export the value to Excel into cell A1. How can I loop the script below continuesly and record the value into a new cell each time? (In the same column) I used a VERY SIMPLE notepad example: CODE$Init = TimerInit() Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) Run('notepad.exe') WinWait("Untitled - Notepad","") If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","") WinWaitActive("Untitled - Notepad","") Send("hello{ENTER}{ENTER}{ENTER}this{SPACE}{ENTER}{ENTER}is{ENTER}{ENTER}a{SPACE}{SPACE}test{ENTER}{E NTER}{ALTDOWN}e{ALTUP}f") WinWait("Find","") If Not WinActive("Find","") Then WinActivate("Find","") WinWaitActive("Find","") Send("c") MouseMove(339,80) MouseDown("left") MouseUp("left") WinWait("Untitled - Notepad","") If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","") WinWaitActive("Untitled - Notepad","") Send("{ALTDOWN}f{ALTUP}x") WinWait("Notepad","") If Not WinActive("Notepad","") Then WinActivate("Notepad","") WinWaitActive("Notepad","") Send("n") Sleep(2000);2 seconds $Seconds = Round(TimerDiff($Init)/1000, 2) MsgBox(0, "Time", $Seconds) #include <ExcelCOM_UDF.au3> Local $oExcel = _ExcelBookNew() ;Create new book, make it visible ;Declare the Array Local $aArray = ;_ExcelWriteArray($oExcel, 1, 1, $aArray) ; Write the Array Horizontally _ExcelWriteArray($oExcel, 1, 1, $aArray, 1) ; Write the Array Vertically, starting on the 5th Row MsgBox (0, "Exiting", "Press OK to Save File and Exit") _ExcelBookSaveAs($oExcel, "c:\Temp.xls", "xls", 0, 1) ; Now we save it into the temp directory; overwrite existing file if necessary _ExcelBookClose($oExcel) ; And finally we close out Also tried doing it this way: CODE$Init = TimerInit() Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) Run('notepad.exe') WinWait("Untitled - Notepad","") If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","") WinWaitActive("Untitled - Notepad","") Send("hello{ENTER}{ENTER}{ENTER}this{SPACE}{ENTER}{ENTER}is{ENTER}{ENTER}a{SPACE}{SPACE}test{ENTER}{E NTER}{ALTDOWN}e{ALTUP}f") WinWait("Find","") If Not WinActive("Find","") Then WinActivate("Find","") WinWaitActive("Find","") Send("c") MouseMove(339,80) MouseDown("left") MouseUp("left") WinWait("Untitled - Notepad","") If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","") WinWaitActive("Untitled - Notepad","") Send("{ALTDOWN}f{ALTUP}x") WinWait("Notepad","") If Not WinActive("Notepad","") Then WinActivate("Notepad","") WinWaitActive("Notepad","") Send("n") Sleep(2000);2 seconds $Seconds = Round(TimerDiff($Init)/1000, 2) MsgBox(0, "Time", $Seconds) #include <ExcelCOM_UDF.au3> ; Include the collection ; Open new book, make it visible Local $oExcel = _ExcelBookNew(1) ; Write a message to the first cell of the first sheet _ExcelWriteCell($oExcel, $Seconds, "A1") ; Now we save it into the temp directory; overwrite existing file if necessary _ExcelBookSaveAs($oExcel, "c:\temp.xls", "xls", 0, 1) ; And finally we close out _ExcelBookClose($oExcel)
  5. Wow!! You are the man!! Thanks for your help. I really appreciate it. Any idea how I can export this value to Excel? Everytime I run the script it should record the time in seconds in Excel in a new column (same row)
  6. Hi Thanks for the help. I cannot get it working. Do you perhaps have an example? I would just like to record the amount of time in seconds that MS-Word was open export this value in seconds to Excel. Is that possible?
  7. Hi I am very new to Auto IT and hoping you can help. I automated opening an application , doing certain functions in the app and closing the app - that works. But I want to capture the amount of time (in seconds) that the application was open and record this into a log file. This process should loop each time the program is opened + records the app uptime until closed by the user. Is this possible in Autoit? I would appreciate any help you can provide.
×
×
  • Create New...