Help: Clipboard - Selected Area copy to Pages

Heya! Ty so much for answering my previous inquiries in this forum.

Framework:

Mac has the screenshots shortcut -> Copy picture of selected area to clipboard in settings
image

I'm trying to make a macro where it waits for me to determine my selected area and immediately paste it into the apple Pages app.

Previous attempt:

Issue: it is only copying the text after I highlight it like this:

image

rather than copying the image all together from the clipboard

Tried the copy as image within the copy option but not really what I'm looking for. I want the overall image, not just its text.

You're mixing "Copy the current selection" with "put a screen capture of the selected area on the Clipboard" -- I'm going to assume you mean the second.

There's a "Prompt for Screen Rectangle" Action that will pause until you select an area. The "Screen Capture" Action can capture an area of the screen to the System Clipboard, and you can set that area to be that selected with the previous "Prompt".

Putting those together:

If that's not what you are after then work through your process manually, noting what you do at each step along with any assumptions you make and decisions you take, then post the list of steps here so people can see your desired workflow.

1 Like

Ty! That is what I was looking for.

Another question within clipboard for another macro.

Trying to copy image within a websearch (my case duckduckgo images). I already set the macro but something weird is that the copied image I selected is not the one being pasted on pages but rather the previous one in the clipboard.

What might be happening?

nevermind.

I just had to give it some time for the clipboard to load the image.

A simple "pause" was needed.

Edit to add: I see you've worked out why -- here's a more responsive solution that doesn't rely on a hard-coded pause.

It takes a beat for data to be copied -- the KM "Copy" Action waits for the System Clipboard to change before continuing, but if you are using the contextual menu "Copy Image" menu item you'll have to build that in yourself.

The System Clipboard has a "clipboard seed" property -- a number that changes every time the Clipboard does. So you save the original CLIPBOARDSEED() to a variable then test the current seed against the original -- when they are different the copy has happened and your macro can continue.

So something like:

1 Like