Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Script to run Skype with real Alt-F4


  • Please log in to reply
No replies to this topic
XORROR
  • Members
  • 1 posts
  • Last active: Jul 21 2015 09:33 AM
  • Joined: 26 May 2015

I know from Googling this issue that I am not the only person who is deeply annoyed by not being able to quit Skype Desktop directly from the main window of the app. The only way to gracefully quit is to use the context menu on the task bar or the tray icon. The close option in the main menu and the X in top right of the title bar just minimize it. Even Alt-F4 only minimizes Skype. Habit and expectation have caused me to leave Skype running many times by mistake. I don't want that.

 

A cursory search on this forum didn't yield any scripts specifically for solving this annoyance, so here is mine. The intention is to use this script to launch Skype, and for the script to exit when Skype exits. It's minimalist.

  #NoTrayIcon
  if WinExist("ahk_exe Skype.exe")
    WinActivate, ahk_exe Skype.exe
  else
  {
    RegRead, SkypePath, HKEY_CURRENT_USER\Software\Skype\Phone, SkypePath
    Run, %SkypePath%
  }
  #IfWinActive ahk_exe Skype.exe ahk_class tSkMainForm
  !f4::
  WinClose
  ExitApp
  Return
  #IfWinActive

There is certainly a lot more one could do, such as capturing clicks on the X, even hooking or replacing the menu so that close does what it should. But there are other more interesting things to do with my time. Just restoring proper Alt-F4 behavior is plenty good enough for me. Also, If I were a non-programmer looking for a fix for this annoyance, I hope I would shy away from programs or scripts that hook in to or modify the behavior of applications beyond what I could easily understand. So I've kept it ultra-simple.

 

If there is already a script addressing this, I apologize. Go ahead and move or remove as you see fit.