Adding Signature in Preview

Hi all,
I am trying to automate the process of adding a signature to a PDF using Preview. As you might know, signatures are under Tools>Annotate>Signature. However, the macro builder in KM will not see the actual signatures (perhaps because they are images?) and I can’t get the macro to choose one from that menu. Is there a way to select the first, second etc. element of a menu without knowing their names? I guess it would be possible to achieve that by using combinations of arrow keys etc, but I was wondering if there is a more appropriate way to interact with menus.
Thanks in advance for your help!
Giovanni

Have you tried the Select or Show a Menu Item action (KM Wiki), using a Path of Tools>Annotate>Signature ?

This should show the "Signature" menu, and then you may be able to select the desired Signature by typing the first few characters of the menu item.

yes, this is what I have tried, but unfortunately the signatures don’t have text (only the picture of the actual signature) so I can’t select one other than by clicking or using the cursor keys. thanks for getting back to me!

Is there more than one signature stored? If not, this will work:

If there are more, some AppleScript can probably select the correct signature.

1 Like

I have always had success using the Show Menu Action with the Menu Item field blank, followed by Type a Keystroke Actions specifying down or up arrows (these can be set within a Repeat Action), and concluded with (as @cfriend specifies) a Type a Keystroke Action specifying return . Works fine with the Signatures menu items in Preview.

"Up arrow" starts from the bottom of the fly-out menu item list.

The following will insert the third signature in the list:

As always, there is good additional information on the KM Wiki Help page for the Select or Show Menu Action.

Is there any way in KM to specify the menu item by position?

3 Likes

As a general rule, if you can do it, KM can do it too. In this case, have KM use the cursor keys. See my response below.

2 Likes

Arrow keys work well. Thanks all!