Help with screencapture please

Hello,

This link https://ss64.com/osx/screencapture.html explains how to “Capture an image of the whole, or part of the screen”.

-i Capture screen interactively, by selection or window.
The control key = copy screen to the clipboard.
The space key will toggle between mouse selection and
window selection modes.
The escape key will cancel the screen shot.

I tried using this

if Keyboard.AsyncKeyDown(&h31) then
TheExecuteString = “screencapture -i ~/Desktop/” + Replaceall(TheNameString, " ", “_”) // TheNameString is the name of the image file
s.Execute TheExecuteString

but I am still getting the mouse selection crossbars, how can I configure that for the “window selection” option/

Thanks.

Lennox

From ‘man screencapture

[quote] -w Only allow window selection mode.

 -W      Start interaction in window selection mode.

[/quote]

so ‘screencapture -w’ will force window mode and ‘screencapture -W’ will start in window mode but allow area selection mode.

Thanks Jim,

Works great, but with the -w, can that be modified just to show the contents of the window rather than the whole window. i.e. the window without the title bar?

Thanks again.

Lennox

[quote=425986:@Lennox Jacob]Works great, but with the -w, can that be modified just to show the contents of the window rather than the whole window. i.e. the window without the title bar?

[/quote]
Not that I know of.

You might want to look at the MonkeyBread Plugins CGWindowMBS. kCGWindowImageBoundsIgnoreFraming would let you ignore the frame and just capture the contents. It could potentially be done via declares, but much much simpler with the plugins.

OK Jim,

Thanks again.

Lennox