title: Delete the playing file in Media Player Classic with Autohotkey
body: <p>I'm trying to make a quick delete button on MPC, I have put on a code in Autohotkey that works, but it seems to break after the first file deleted.</p>
  
  <pre><code>#NoTrayIcon
  #Persistent
  #HotkeyInterval,100
  #NoEnv
  SetKeyDelay, –1
  SetTitleMatchMode, 2 ; Makes matching the titles easier
  SendMode Input
  SetWorkingDir %A_ScriptDir%
  #SingleInstance Force
  
  Del::
  getFilenameViaProperties()
  
  getFilenameViaProperties(){
  
    WinGetTitle, Title, A
    WinGet, activePID, PID, A
    PostMessage, 0x111 , 814  , , , ahk_pid %activePID%  ;WM_COMMAND = 0x111 &amp; wParam found 
    WinWait, Properties ahk_class #32770 ahk_pid %activePID%
    Send ^{tab}
    ControlGetText, fileName, Edit1
    ControlGetText, directoryName, Edit6
    WinClose
    loc = %directoryName%\%fileName%
    Msgbox,4,, DELETE? `n %loc%,20
    IfMsgBox, Yes
      {Send +{Down}
      Sleep 200
      FileDelete, %loc%
      Sleep 700
          IfExist, %loc% 
          {Send ^{c}
          Sleep 200
          FileRecycle, %loc%
          }
    }
  }  
  return
  </code></pre>
  
  <p>note:</p>
  
  <p>Hotkey= Delete button</p>
  
  <p>Next file= Shift {Down}</p>
  
  <p>the code seems running fine, but after deleting the first file, it wont work again.</p>
  
  <p>Any help?</p>