Area Screen shots? And a little frustrated rant from a newbie

Is there a way with KM {and /or another tool] to take area screen shots of varying size at any given time? I see that there is an AREA option in the screen capture tool but it appears that it’s limited to doing a specific size. I;m always snapping a pile of different photos of all different sizes. So a fixed size is just as cumbersome as just shooting the whole screen and cropping them all over again.

I’m new at this - well I’ve owned KM since at least version 3, and basically did nothing with it all those years except re-write a few unhelpful hotkey combinations for PowerPoint and Photoshop plus a slew of URL shortcuts. I think it was so unproductive because everything just seems so long and complicated …and not well documented - so the learning curve is hefty. Today’s one macro adventure took A LOT of detective work piecing bits of this post and that post together just to write a basic screen cap macro which I[m SURE has been done a MILLION TIMES.already.

Call me dumb (but actually I’m a pretty tech savvy guy - but unfortunately I;m not a programmer) so it took me three hours today just to research all the bits and pieces from the wiki and forum to cobble together a basic main screen, screen capture written to a file with a name and date. It just seems like after all these years, all the basic macros would be all written up in great detail by now, so newbies could basically just copy down the steps and have it work.I found only 4 little cryptic snippets on creating screen grabs and writing them to a file. Why are WE ALL reinventing the wheel with every macro. After six years, I FINALLY figured out how to automate the opening of my favourite set of apps and having all the windows consistently align just perfect on the screen each time I use them.

I can see MAJOR potential in KM, but it’s been a slow and painful journey with little progress…and lots of effort (and swearing). I REALLY want to get KM down, because the possibilities are limitless - in theory.

FYI Screen Grab or screen capture aren’t even known keywords to tag my comments with.

1 Like

I’m a bit tired, so I’m not sure if I captured all of what you’ve said. (And you said many things.)
But let’s give it a try:

[quote="], post:1, topic:6034"]
Is there a way with KM {and /or another tool] to take area screen shots of varying size at any given time?
[/quote]

You know that you can take screenshots of an area with ⇧⌘4 ? (This is a system shortcut, not KM.)[quote=“joensf, post:1, topic:6034”]
well I’ve owned KM since at least version 3, and basically did nothing with it all those years except re-write a few unhelpful hotkey combinations for PowerPoint and Photoshop plus a slew of URL shortcuts. I think it was so unproductive because everything just seems so long and complicated …and not well documented - so the learning curve is hefty.
[/quote]

The “problem” with KM is that it is very beneficial to have some basic knowledge of the inner workings of the macOS, of the BSD layer (“Terminal”) and of AppleScript or JavaScript for Automation. Well, it’s not really a problem, but the more you know about those things the more you will benefit from KM.
But even if you don’t know nothing at all about that, KM will be useful; just to a minor degree. And it will grow with you.[quote=“joensf, post:1, topic:6034”]
Call me dumb (but actually I’m a pretty tech savvy guy - but unfortunately I;m not a programmer)
[/quote]

This is fluent; there are programmers who are not very tech-savvy.

Not sure if this is the correct approach, but I would treat KM just like any scripting language/API. You definitely have to learn it. But KM has the advantage of offering a very easy entry point. And, later on, you’ll discover that it plays very well with AppleScript or JavaScript for Automation, or Swift.

Just some thoughts.

Is there a way with KM {and /or another tool] to take area screen shots of varying size at any given time?

The above has Left, Top, Width and Height options. If you need to use variables, just type in the name of the variable in each field, and it will switch to look like this:

Right there with you. Yes, the learning curve can be steep. Sometimes even more so for the technically savvy, because those are the people who want to jump right into the complex stuff.

As for the swearing, the first programming language I ever learned was called CURSE. (Just kidding, well, kind-of.) My often-repeated chant is "Nothing is easy", usually followed by a stream of profanity.

In the long run, KM really is worth the time and effort. And in fact, that's why so many of us stay on this forum to help people through the painful process you're struggling through.

So ask questions, struggle, whatever. It'll be worth it,

2 Likes

@DanThomas has given you some examples of how to specify the area you want to capture. You could add a Prompt for User Input Action prior to the Screen Capture Area Action, like this:

###MACRO:   @IMAGE Enter Area to Screen Capture [Example]

~~~ VER: 1.0    2017-01-14 ~~~

####DOWNLOAD:
@IMAGE Enter Area to Screen Capture [Example].kmmacros (3.6 KB)



###Need Specifics from You

However, we could offer you much better help if you could be more specific about your needs.

Can you provide an example, step-by-step, of your workflow, doing it manually?


###Resources

Also, the easiest way to capture an arbitrary section of the screen is using the macOS tool that @Tom mentioned.  See [How to take a screenshot on your Mac](https://support.apple.com/en-us/HT201361).

There are a number of existing Macro published in this forum that will help you deal with and manage screen captures.  We have two tags that will help you find the macro of interest:

* https://forum.keyboardmaestro.com/tags/screenshot
* https://forum.keyboardmaestro.com/tags/image

So, you see, there are actually many pre-built Macros available to you.
Most macros are published in the ["macro" Category (sub-forum)](https://forum.keyboardmaestro.com/c/macro).

Like any technical subject, Keyboard Maestro has its terms, some of which are unique to KM.  It will take you a short while to learn then, but then doing so you will be able to easily search the forum to find what you need.

**Getting Started with Keyboard Maestro**

* Read the [Quick Start](https://wiki.keyboardmaestro.com/Quick_Start).
  * This is essential to become familiar with KM terminology
* Do the tutorial (Help ➤ Tutorial) in the KM Editor.
  * Gives you a live walkthrough of creating a macro in the KM Editor
* Review/Browse the Available [Macro Actions](https://wiki.keyboardmaestro.com/Actions)
* For Help with an Action in your Macro, click on the gear icon <img src="/uploads/default/original/2X/f/f1f820852b2301d32534138e4cf4b093cdadf89b.png" width="25" height="21"> at the top right of the Action, and select "Help"
* Start small, and grow your macros organically.
* Be prepared for some trial and error in the beginning.
* Make good use of this [Keyboard Maestro Forum](https://forum.keyboardmaestro.com/)
  * Search for existing macros
  * Post your questions/issues if you get stuck

###Searching The Forum

I just realized we don't have any instructions on how to search the forum.
I will create them soon, but for now:

1. Click on the magnifying glass at the top right of the page:
<img src="/uploads/default/original/2X/d/d32d4f7ba09cb133446249f8b4237d060096b6f4.jpg" width="148" height="69">
.
2.  Then you will see:
<img src="/uploads/default/original/2X/a/a6d242b7b118452a5dad8b589984bc4fa21346c9.png" width="579" height="138">
.
3. Click on "options" for Search filters:
<img src="/uploads/default/original/2X/7/7d17dad7664de7e0f6bbc1a8329a8983e5422c77.png" width="690" height="469">
.
4. So, if you want to see macros about screenshots, type:
`#macro screenshot`
<img src="/uploads/default/original/2X/d/d4db529a34a25baf9b03912e0d26fee7219a177b.png" width="575" height="584">

Feel free to ask any follow-up questions about your OP, or start a new topic for questions on other subjects.

1 Like

There have been some useful responses that cover the basics.

The best way to start using Keyboard Maestro is to start simple:

  • Read the Quick Start (Help menu)
  • Do the Tutorial (Help menu)
  • And then grow your macros organically, starting simple.
  • Join the forum and ask for help with any macros you get stuck on.

You mentioned “varying size” but did not say how you wanted to specify the varying size. How you want to choose what size is an important part of answering your question fully. Keyboard Maestro can take screenshots of varying sizes (as people have shown), so the question is how does the size vary and how do you want to specify it.

1 Like

Thank you for your answer. Here’s what I’m really attempting to do…

Yes, I’m very aware of the OS X ⇧⌘4 SCAP OS X keyboard shortcut. I love that screen capture function, it does exactly what I want it to do - without fuss. As a graphic designer/photographer I do a TON of variable AREA screen captures every day - some to PNG files and some to the clipboard. I’m REAL LAZY, so I WANT to trigger those variable-area screen captures via one of the 10 handy buttons on my Logitech VX Revolution mouse…so I can do them rapid fire without ever looking at my keyboard and using the awkward ⇧⌘4 key combo.

The VX Revolution is the only 10-button programmable mouse that I have found that works reliably (all 10 buttons) as a dedicated recognizable KM macro triggering device. Those 10-button (+modifier keys) work perfectly for ALL of my other 128+ KM Macros I have programmed to them… EXCEPT for this one DARMN VARIABLE AREA SCREEN CAPTURE macro where I used KM to program one of the mouse buttons (tried all 10 buttons) to specifically trigger a TYPE ⇧⌘4 KEYSTROKE macro. When executed, I found that there’s a weird BUG in KM or the VX Revolution hardware (FYI I did NOT load the Logitech S/W drivers since they limit the mouse button functionality).

The end result of that macro is that 20% of the time I trigger it, it executes a FLAWLESS variable area screen capture (just as if I really pressed ⇧⌘4 or ⌘4 keys on the keyboard, thereby changing the cursor to cross-hair mode and waiting FOR ME to marquee out MY DESIRED screen area, which it then writes it to a time stamped PNG file on my desktop or writes it to the clipboard respectively. Oddly, and frustratingly so, the other 80% of the time the macro is triggered using a mouse button, it will…all on its own, in a split second, convert the cursor to cross-hair mode (as it should) but IT will then marquee out a screen selection area by default that always begins exactly at the 0,0 screen coordinate position, extends exactly down to wherever the cursor happens to be sitting on the screen at the time of trigger and records that to a PNG file or clipboard - that happens 80% of the time, exactly as described, it DOES NOT WAIT FOR ME to make the selection area, as it should.

I find it VERY frustrating to me that it doesn’t work properly EVERY TIME! It’s the WHOLE REASON I bought up every remaining VX Revolution mouse I could find and the main reason I have owned every version of KM since v3.0. But I can’t get it to work DARN IT!

Dan,

Thank you for suggesting a possible solution, but I think I did something worng because it doesn’t work even though my editor window has the EXACT same commands in it.

When I execute your second macro example (the variable version) it isn’t variable. It captures an area of the screen beginning at the 125, 125 screen coordinate and captures a 600px x 250px x 72dpi image area below that point.

So I must have done at least two things wrong, because A) it’s not variable at all on my Mac - it captures a specific area and size of my screen each time, and because B) the screen it does capture is DOUBLE the size specified in the first step of the macro???

I don’t understand WHY in the first step we’re specifically entering coordinates for capture area and a capture size numerically if it supposed to be variable?? Even so, nor do I understand why it’s capturing an area that DOUBLE the specified size on my MBP 15"Retina

I’m not questioning your wisdom - as I am the new one at this, but it doesn’t make sense the way it’s scripted out (to me at least), and it doesn’t do what it’s supposed to, and why on earth is it capturing double the screen area?

Assign this macro to your mouse button and see if if you get the same buggy behavior.

The macro does not press ⌘4 or ⇧⌘4, it runs the screencapture tool via the shell. So this might make a difference. Perhaps.

_[test} Simple Screen Capture with Mouse Selection Mode.kmmacros (1.4 KB)

It copies the image only to the clipboard. But it is just for testing.

If this method works for you, then you can try my Enhanced Screenshot macro, which works in a similar way but offers the full set of options (save to file, naming, etc.). Or, if this is too much, we can build something in-between.

1 Like

Have you tried @Tom’s suggestion os using Execute Shell Script: screencapture -s -c?

Have you tried triggering your macro on the release of the button instead of the press?

It sounds to me like the system is seeing the button release as the completion of the drag, and yet never saw the button press (since that was before the the Command-Shift-4) ands so taking the screenshot from 0,0 to the mouse up location. By triggering it on the mouse button release (and possibly adding a short pause as well) you would remove that option.

1 Like

Hey @joensf and all. Had a similar goal and this seems to work for me.
Pasted_Image_11_24_19__11_56_AM

1 Like

my 2c: SnagIt is a great app for capturing screenshots, it remembers last size and position.
Great for repetitive tasks.

A post was split to a new topic: TIP: How to Automate Screen Capture Using Bash screencapture Command