Jump to content

GeekGirl

Members
  • Posts

    7
  • Joined

  • Last visited

About GeekGirl

  • Birthday October 28

Profile Information

  • Location
    Texas
  • Interests
    Learning, My dogs are my life, anything outdoors, self love.

Recent Profile Visitors

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

GeekGirl's Achievements

Seeker

Seeker (1/7)

1

Reputation

  1. I love any and all approaches. I appreciate you. I'm having fun learning AutoIT. Struggling still, but learn more everyday! I will keep your code in my pocket of tools as well.
  2. You did it! You just made my day!!! I have been struggling for days and lost sleep over trying to figure this out......and the notepad closes out without asking to save. I thank you so very much!
  3. OMG, I could hug you. That worked! Now where do I put the WinClose("[CLASS:Notepad]", "") if they do have notepad still opened after the the 30 seconds have passed? NotePad() Func NotePad() WinWaitActive ("[CLASS:Notepad]") If WinExists("[CLASS:Notepad]") Then ;start Timer Dim $i_TimeStamp = TimerInit() Dim $i_TimeToCountDownFromSeconds = 30 Dim $i_OriginalSeconds = $i_TimeToCountDownFromSeconds While WinExists("[CLASS:Notepad]") If TimerDiff($i_TimeStamp) >= 1000 Then ToolTip($i_TimeToCountDownFromSeconds) $i_TimeStamp = TimerInit() IF $i_TimeToCountDownFromSeconds = 0 Then Exitloop $i_TimeToCountDownFromSeconds -= 1 EndIf sleep(10) WEnd Msgbox(0,"Done!","Done counting down from " & $i_OriginalSeconds & ".") ;testing purposes only ;WinClose("[CLASS:Notepad]", "") ;MsgBox(0,"Error", "Time Out") Else MsgBox($MB_SYSTEMMODAL + $MB_ICONERROR, "Error", "Window does not exist") EndIf EndFunc ;==>NotePad
  4. I am actually going to take that completely out. That was just for testing purposes. I just need notepad to to completely close out after the 30 seconds and have that message box titled error say they exceeded the time. I am getting that far, but what happens is if they do get out of notepad before the 30 seconds,,that timer keeps going. So it can't move onto the next process.
  5. Hi, I am fairly new to AutoIT. I have been reading through all of the forums and still racking my brain not being able to figure this out. So I need a timer that starts when the user opens notepad. They only have 30 seconds to complete their process. If they pass the 30 seconds notepad needs to close out cleanly (is there a way to have it close out without it asking to save?) and then an error window pop up displaying that they have exceeded the time limit. I am able to do the above fine. The problem is I also need the timer to stop if the user closes out of notepad before the 30 seconds has passed, but I am struggling with how to exit that loop. I have coded in many different ways, here is the solution I am working with, but can't get it to stop the timer if notepad has been closed prior to the 30 seconds. NotePad() Func NotePad() WinWaitActive ("[CLASS:Notepad]") If WinExists("[CLASS:Notepad]") Then ;start Timer Dim $i_TimeStamp = TimerInit() Dim $i_TimeToCountDownFromSeconds = 30 Dim $i_OriginalSeconds = $i_TimeToCountDownFromSeconds While 1 If TimerDiff($i_TimeStamp) >= 1000 Then ToolTip($i_TimeToCountDownFromSeconds) $i_TimeStamp = TimerInit() IF $i_TimeToCountDownFromSeconds = 0 Then Exitloop $i_TimeToCountDownFromSeconds -= 1 EndIf sleep(10) WEnd Msgbox(0,"Done!","Done counting down from " & $i_OriginalSeconds & ".") ;WinClose("[CLASS:Notepad]", "") Else MsgBox($MB_SYSTEMMODAL + $MB_ICONERROR, "Error", "Window does not exist") EndIf EndFunc ;==>NotePad
  6. Thank you! I knew I was doing something wrong. I apologize.
  7. Hi, I am fairly new to AutoIT. I have been reading through all of the forums and still racking my brain not being able to figure this out. So I need a timer that starts when notepad is opened. It can only be opened for 30 seconds. When it hits 30 seconds I need notepad to close out cleanly (is there a way to have it close out without it asking to save?) and then an error window pop up displaying that they have reached their time limit. I am able to do the above fine. The problem is I also need the timer to stop if the user closes out of notepad before the 30 seconds has passed, but I am struggling with how to exit that loop. I have coded in many different ways, here is the solution I am working with, but can't get it to stop the timer if notepad has been closed prior to the 30 seconds. NotePad() Func NotePad() WinWaitActive ("[CLASS:Notepad]") If WinExists("[CLASS:Notepad]") Then ;start Timer Dim $i_TimeStamp = TimerInit() Dim $i_TimeToCountDownFromSeconds = 30 Dim $i_OriginalSeconds = $i_TimeToCountDownFromSeconds While 1 If TimerDiff($i_TimeStamp) >= 1000 Then ToolTip($i_TimeToCountDownFromSeconds) $i_TimeStamp = TimerInit() IF $i_TimeToCountDownFromSeconds = 0 Then Exitloop $i_TimeToCountDownFromSeconds -= 1 EndIf sleep(10) WEnd Msgbox(0,"Done!","Done counting down from " & $i_OriginalSeconds & ".") ;WinClose("[CLASS:Notepad]", "") Else MsgBox($MB_SYSTEMMODAL + $MB_ICONERROR, "Error", "Window does not exist") EndIf EndFunc ;==>NotePad
×
×
  • Create New...