How to Select Fields in "PDF Security Options"

I'm trying to create a macro to encrypt a PDF.

I've gotten as far as the PDF window called "Security Options", which seems to require a mouse click in a checkbox to begin filling out what I need to fill out, but I can't figure out how invoke that mouse click.

If I can just get the macro to click next to "Require password to open document", I can figure out the rest. But how do I get the Mac to click that checkbox?

Use the Click at Found Image action

To click relative to an image, you use the Mouse Click action, configure it to be relative to a found image, and take a screenshot of the desired area of the screen using Command-Control-Shift-4, and paste it into the image well on the action. The image has to be unique (which includes not being visible in the action if the image is small enough not to be shrunk in the image well) otherwise Keyboard Maestro will not know where to click. The Display option in the action will allow you to see where Keyboard Maestro is matching.

In what application?

Peter's suggestion is a good one.

You can probably also turn on 'Change How Tab Moves Focus' and tab through the dialog with Keyboard Maestro.

image

The spacebar will allow you to toggle active checkboxes.

Genius. I really appreciate Peter's suggestion but just couldn't get the Found Image to work. Changing the way tab moves focus solved this - and several other - problems for me.

Many thanks.

1 Like

Glad you got things working satisfactorily.

Using found-images can a bit fiddly but they are a very powerful tool.

Play around with this on your system:

Found Image Example v1.00.kmmacros (19 KB)
Keyboard Maestro Export

Click in the image well and use the spacebar to magnify it and see what it is.

Use 4 to capture your image.

Hold down the key when actually capturing it, so it will be copied to the Clipboard.

Start by closing all windows in the Finder but one – then add more and see how that affects the action.

I've got the action set to use the main screen, because the sidebar in a Finder window is not considered part of the front window. That can really mess your head around...