Saving screenshots with name of title bar
Here is the appleScript that would achieve what you are looking for:

do shell script "screencapture -W ~/tmp"
delay 3
tell application "System Events"
    set frontApp to name of first application process whose frontmost is true
end tell
tell application frontApp
    if the (count of windows) is not 0 then
        set window_name to name of front window
    end if
end tell
set screenShotName to do shell script "date +%Y%m%d_%H%M%S_"
set screenShotName to screenShotName &amp; window_name
do shell script "mv ~/tmp ~/\"" &amp; screenShotName &amp; "\".png"


Copy and paste the above into appleScript editor then save it as an app, you can name it whatever you want. 

Double click the app icon select the window you want screenshoted and then make sure that you click that window to ensure it is the front one.