screencapture

When calling screencapture in terminal

the command responded as expected, and copied the image to the clipboard.

When calling Screencapture from Applescript via “do shell script”

do shell script "screencapture -ci"

the command responded with a strange rectangular tan block and without any screen capture in the clipboard.

Other failed solution attempts included

  1. Changing the screencapture destination to a file
  2. Preceding the shell script command with “/usr/sbin/”, as in
do shell script "/usr/sbin/screencapture -ci"

Does anyone have a solution to this screencapture conundrum?

I am equally flummoxed as to any reason for the failure of my applescript invoked screencapture. I am comfortable with the screencapture shell command as I have successfully employed it, via terminal. I have also attempted to disable screen capture’s shadow, so that now in addition to my prior failed fixes, my list of failed attempts now includes:

  1. disabling screencapture’s shadow.

Screencapture defaults invoked by

do shell script "defaults read com.apple.screencapture"

now returns

Possible thoughts on resolving this dilemma:
A. Complications to applescript calling a shell script
B. Complications that produce a rectangular tan box rather than any image in screencapture
C. Underlying preferences that Applescript calls when copying an image, that precede screen capture’s execution

Thanks for your help, and I look forward to any further insights on overcoming this script barrier.

Browser: Safari 605.1.15
Operating System: macOS 10.14

I have researched this problem, a little further. I now note that my screencapture command works:
• when called in Terminal
• when called by keyboard command command + shift +4 in any application
• when called in Script Editor

but returns no copied image but only a tan rectangle, whose size appears to match the size of the mouse coordinates, employed when the screencapture command was called.

How might a tan rectangle with mouse coordinates be trigged by something in Applescript when run in Script Debugger?

Depending on the version of macOS, you should be prompted to give Script Debugger access to Screen Recording in preferences the first time you try.

Thank you, Shane, your solution resolved my problem.