title: Pause / Restart AutoHotKey text playback
body: <p>I have a simple AHK script that plays back text into an editor ( <em>see script below</em> ).</p>
  <p>I want to be able to <strong>Pause</strong> / <strong>Resume</strong> the playback by pressing a sequence of keys.</p>
  <p>I reviewed a few solutions here &amp; at various AHK sites w/o success.</p>
  <p>The script below should startup when I type Mike XXX ( and then press enter )  and should pause / restart when I use the Ctrl+Alt+P key sequence ...if I uncomment the Pause key sequence the script does not run at all ...any thoughts ?</p>
  <p><strong>++++++++++
  AHK Script
  ++++++++++</strong></p>
  <pre><code>#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  
  ; ================ Define PAUSE key sequence ======================
  ;^!p::Pause  ; Press Ctrl+Alt+P to pause. Press it again to resume.
  ; =================================================================
  
  BAS1 =  
  (
  This is line 1 of some text 
  )
  BAS2 =  
  (
  This is line 2 of some text 
  )
  BAS3 =  
  (
  This is line 3 of some text 
  )
  
  ; ==================================================
  ; ====================== Start BAS definitions
  ; ================================================== 
  
  ::Mike XXX::
  send, Mike XXX
   send, {enter 2}
  SendDelay(BAS1)
   send, {enter 2}
  SendDelay(BAS2)
   send, {enter 2}
  SendDelay(BAS3)
   send, {enter 2}
  
  return
  
  ; ==================================================
  ; ====================== End BAS definitions
  ; ================================================== 
  
  
  SendDelay(text) {
  
    Loop, parse, text
    {
      Random, rdel, 5, 9
      Random, rdur, 6, 9
      SetKeyDelay, %rdel%, %rdur%
      Sendraw % A_LoopField
    }
  }
  
  ; =================================== End Methods
  </code></pre>