Automate Share to iPad from Pages on Mac

Hi,

How would I make the following macro?

In Pages, I want to send the current document to my iPad via AirDrop.

I have this part right...

Now how do I get KM to click PDF in the pop up window?
KM 2

Then select Next...

Then in the next window find and select Joseph Chase

KM 3

Pause for upload then select done in the final window

I appreciate any help anyone can give.

Here is a link to a video that explains more completely. Thanks.

@ChaseJoe

You could use the Press Button action.

To select your iPad you can use the Click and Image Found action:

I hope this help you. If not, reach out!

KC

I'll give that a try. Thanks so much!!!

Works all the way until last step. It is not finding the image or clicking it.

Try a 1 second pause before the image found action and see if it works.

Edited: Do this... as the AirDrop popup may be slow propagate.

Here is the full macro:
AirDrop PDF.kmmacros (24.4 KB)

2 Likes

FWIW, a solution that doesn't use the GUI. You can use Execute a Javascript For Automation action, you can export Pages front document using:

(() => {
    "use strict";
    
    const
        a = Application.currentApplication(),
        sa = (a.includeStandardAdditions = true, a),
        appPages = Application("Pages"),
        doc = appPages.documents[0],
        path = Path(sa.pathTo("downloads folder").toString() + "/test.pdf")
    return (
        appPages.export(doc, {
            to: path,
            as: "PDF"
        }),
		path.toString()
    )
})();

I guess the problem is that the caught image cannot be found because of the dialog where the destinations appear is partly transparent at least below the text part of it. That means if you have a blank white background or a mix of black and white or even red text like in your example the "image" to be found changes accordingly.

I'd try to just use just your image as the destination for the click. I.e. about like so…

image

This ain't transparent and always looks the same. You can also work with the slider in the Found Image action.

To know if the image is recognized I also sometimes switch on "Display" just temporarily.

It then gets a green overlay when found.

1 Like

Yay this worked! Thank you so much.

1 Like

@ChaseJoe - You are welcome. Be sure to select the solved checkbox :ballot_box_with_check: , under the solution, so that others that encounter this situation can know the solution that worked for you.

Take care,
KC