Struggling to Create a Quick Macro to Cancel FaceBook Invitations

Hi everyone, I'm trying to create a macro but I encounter some difficulties.
Here is the automation I want to create :

I have a huge list of "friendship invitations" I want to cancel on Facebook, so to do so I want to automate this repetitive action in order to do it just one time, and let my computer do it as many time as it is necessary.

So this is the plan :

  1. First I have to pass the mouse over the "Invitation envoyé" (Sent invitation) button, to make appear the drop down menu.

  2. Then, I'll have to click on the last part of this menu, on the "annuler l'invitation" (cancel the invitation) part

  3. Now, a chat box will appear, and i'll have to confirm the deleting of the invitation by clicking on "annuler l'invitation" (cancel the invitation) again.

  4. When it's done I can do the same thing for the invitation just below, and so on.

  5. Until I reach the last one on the page. Then, rather than by scrolling. I'll hit the "down page" button on my keyboard to access to the rest of the list, and I'll loop this action endlessly until the whole list is done.

My problem is :
When I record all of this, and I play it, keyboardmaestro play the action to quickly, like instantly so the different menu haven't the time to load and the action are not executed at all. Did someone now a way to chose the speed of execution of the different tasks ?


You're probably just missing pauses in your workflow. You can find them under Control Flow. If you need to get more advanced than that, there's javascript you can run to check if an element is visible.

1 Like

Yeah thanks it's way better ! But now I have a new problem lol, when KM reproduce my mouse moves, it never ends up on the right place, I can't make it to click exactly on the button I need it to click on. With javascript I'll be able to select the buttons without having to click on them if i understand well ?

Hmm.. I'm not sure if you'd want to go into that level with javascript but I'm wondering how your mouse click is set up? Are you using "Click on Found Image" and finding an image on the screen or "Move or Click Mouse"? In the macro, you may want to check if it's relative to absolute position vs relative to a window corner, etc.

I succeeded, but in order to record my movements accurately I have to hit the "Get" button of every actions and redo them. I will leave javascript for the moment, but if it were you, how would you do it ?

Oh by the way the default setting was on "front window's corner" so I tried different "location" but none seemed to do what I first did while I was recording, and to be honest I don't understand how that "locations" works.

Honestly popups have been somewhat tricky for me.. some accept a "return" key simulation. Others have been pretty unresponsive so I would do a mouse click just like you mentioned. If the popup always shows up in the same place, I would do an absolute mouse position. If it changes position, maybe you could resize the page and then use absolute positioning, or use an image to get the area to click. Sometimes, an action like "Press a Button" might work.. I didn't realize popups would be so complicated so it's hard to say!

Here's the wiki for Move or Click Mouse:

Basically there will be a click that will happen at some position relative to the location of the window/image/current mouse position/etc. If you choose absolute position, the click will happen at the exact coordinates you specified and wouldn't move relative to anything else.

Hey @Zedohix,

So-called Quick-Macros are generally NOT quick at all.

Keyboard Maestro is very literal in what it records, and it rarely creates a really useful, repeatable macro for anything halfway complicated when recording.

What it does do is provide you with a sequence of steps that can spark your understanding of the process and that may be modified and added-to/subtracted-from to achieve your purpose.

You probably want to start this operation with a Found Image condition.

See this thread for ideas:

Specify Closest Image on Move and Click at Image Action

Do NOT try to create a sequence at first.

Get one single instance of your Cancel-Invitation action working – then work on creating a sequence.

By the way – doesn't FaceBook have a means to mass-cancel invitations? (It's been awhile since I looked.)


1 Like