screencapture.scpt
display dialog "select type" buttons {"Window+sub", "fullScreen", "Selection"} default button 1
set btsel to button returned of result
display dialog "set time" buttons {"3", "6", "8"} default button 2
set btnum to button returned of result as number
set myFilename to "~/Desktop/SS_" & (do shell script "date '+%y%m%d%H%M%S'") & ".png"
if btsel is "Window+sub" then
do shell script "sleep " & btnum & " && screencapture -iCWS " & myFilename
else if btsel is "fullScreen" then
do shell script "screencapture -CT" & btnum & " " & myFilename
else if btsel is "Selection" then
do shell script "screencapture -isCT" & btnum & " " & myFilename
end if
(*
tell application "Adobe Photoshop CC"
activate
tell application "System Events"
keystroke "n" using command down
keystroke return
keystroke "v" using command down
end tell
end tell
*)
Window+subは、ダイアログ中のpull-down menuも同時にキャプチャする。