LoginSignup
2
2

More than 5 years have passed since last update.

screencaptureコマンド選択applescript

Posted at
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も同時にキャプチャする。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2