$ man screencapture
...
-c Force screen capture to go to the clipboard.
-T <seconds> Take the picture after a delay of <seconds>, default is 5.
-x Do not play sounds.
-l <windowid> Captures the window with windowid.
...
# Get window idosascript -e "tell app \"APPLICATION_NAME\" to id of window 1"