If you can send messages by entering text and clicking buttons yourself you should be able to do the same with KM entering the text and clicking buttons. In both cases, any encryption is handled by the browser.
Note that I (still) don't use Facebook. You may get a better response here from people who do if you start a new thread specifically about send Facebook messages and include that in the post's title.
One more question on KM:
Could you please tell me exact (bit-by-bit) what this function do?
There must be something wrong here compared to what I expect it to do...
You should tell us what you expect it to do, rather than have us explain "bit by bit" what it does.
Anyway... what it does is simulate a click at the centre of the bitmap, (in your case, offset up by ten pixels) if and only if there is a unique copy of the bitmap in all screens. If there's more than one copy of that bitmap, the KM Engine generates an error.
The most common errors are: (1) specifying "Unique" when that's not really what you want; (2) use the offsets incorrectly (you may have meant 10 pixels to the LEFT, not UP); (3) not capturing the image correctly, resulting in a scaling problem that refuses to find the image.
I can't really say which solution is correct for you because you haven't stated what your problem is. Did you get an error? Did the mouse move at all?
Just to expand on his first point -- the action you show has a large amount of "fuzziness" applied to its image matching and you're matching on "all screens". The two together greatly increase your chance of multiple matches which can cause the action to fail because you've specified "Unique".
Some apps, particularly web apps, can be a bit slow to respond, so another commonly-used trick is to move the pointer to the button, pause a beat, then click at that point:
Hi,
thanks.
I followed your proposal but still got problems.
What I am trying to achieve is to send a message to current and previous followers - and on Facebook they appear differently when it comes to the button for Message. See attached.
The absolute position is not the same either.
How can I achieve this?
I have tried by if/then else - but not sure how that works on KM.
The IF action doesn't move the mouse if it finds an image. You should change your macro to work like Nige's example, because he is moving the mouse, while you are not.
If the button can take two or more possible forms, there are solutions for that too, but the first thing you should do is follow Nige's advice so that it works for one button shape/colour. Once you get it working for one button shape, I'll help you update it to work for other shapes at the same time.
You're testing for the presence of one button -- but you aren't then using the position result to move the pointer.
But you can test for "any of the following" and include multiple image detections -- details of the last found image will be in the %FoundImage% token, and you can use that to put the pointer in the right place.
Note that "any of the following" short-circuits at the first "truth" and subsequent conditions aren't tested -- %FoundImage% will be the first-detected image in the series, and will be empty if none of the images are found.
Thank you both of you - I got a large step forward.
In fact the macro ran normally as it should all the way until the second alternative appeared. Then it was not recognized/found and went for the ELSE solution. See attachments.
What is wrong here?
I can only guess, since (a) you didn't share your whole macro, and since (b) I can't see your Facebook screen in action, but my guess is that the macro is running so fast it isn't waiting for the new button to show up. Maybe you need to modify the macro to "wait" for a fixed period of time, or "wait until" using the approach I posted above.
THE PREVIOUS DIALOGUE IS NAMED "FACEBOOK" GOING FORWARD.
I will name my questions (if any further) with this name to avoid any mixup.
Because,
in parallell with "FACEBOOK", I also do almost the same with my "LINKEDIN" connections (since I am retiring - I would like to send them a message).
"LINKEDIN"
This macro is in its origin a copy of the Facebook macro - but with some minor changes. Still, there is one major difference.
When a message has been sent using LinkedIn's internal messaging system, the message window remain at the top and need to be exited because it takes too much space of the total window. See attachments.
My setup is the Macbook Pro with a Triple-setup - see attachment, and the LinkedIn part is on the display to the right (named ingnok (1)) - I guess that means something when come to parameterizing. I have tried several solutions but I am not able to click on the X to get it out of the way.
If you need the whole macro, please let me know (and how) and I will send.
FACEBOOK
I entered 5 seconds of Pause and it looks like being the issue.
Thanks.
Otherwise, I have the same issue on FACEBOOK as on LINKEDIN.
I need to get rid of the messaging window before I proceed to next person.
Awaiting your (hopefully) help before I move on.
You're setting the global variable Exit to the details of the last found image.
But your "Move and Click at..." action is using coordinates from the local variable Local_image.
So you should either be getting an error notification that the "Move and Click at..." action failed, or you'll be getting a click in entirely the wrong place because you set Local_image to something else earlier in the macro.
It sounds like you are saying the pause worked. I'm glad to hear that. Although 5 seconds seems quite large. A shorter value like 1 second will likely also work.
I see you are trying to use the mouse to click on the X to get rid of the window. I'm a big user of that method, but in this case the X is so dim that I can't guarantee it will always work. I suggest that you check if there's a keyboard short, like the "Escape" key, that closes the window. Keyboard shortcuts will always work, while Find Image / Click actions will not always work.
Hi again,
tried to post a topic relating to Facebook but no response - so I stick with you here since the questions are still pretty generic.
Look at the attached screenprints of the macro.
After the Message button have been found and click performed the messenger box appear as it should be but the cursor does not end up in the edit field where I can do the Cmd+V command to paste the text from the variable. What am I not seeing here?
You may have to add a "Pause" for some time, or "Pause Until" the textbox image in your last screenshot is on screen, to give the box time to appear
You've a lot of fuzz on that last image detection, so you may be getting a false positive and putting the pointer in the wrong place
If the pointer doesn't move at all it is probably the "Pause" that is needed -- you could also test that by putting a "Display Text: 'No image found' " action in the (currently empty) "otherwise" section.
If the pointer moves to the wrong place it's probably a false positive -- reduce the "fuzziness" of the match.
I have now tried back and forth to the limit of my competence.
I am still not able to make it work.
Can you please check for me?
I have uploaded the full macro, the excel sheet screenshot and a link to the screenrecording. Send msg_txt fra liste-Facebook.kmmacros (73.0 KB)