Left click when pixel color under mouse curser changes from white to black

I am trying to apply a stamp from acrobat (left click) at every vertical black line that the path of my mouse cursor travels on a PDF document. For example, I have a lot of vertical lines on a white background and the stamp is a dot that can be applied on the vertical backline at the x,y location the user moves the mouse cursor crosses over the black line.

I've tried several different posts to no avail. Thanks for any help.

Any help would be appreciated. Thanks

Are the vertical lines spaced at equal intervals?

Yes

-Jason

Then I’d try something like this:

First, find out how many pixels the lines are spaced apart- call it X.

Your macro would then be something like:

Apply stamp
Move mouse pointer X pixels to the right from the current position.

You can trigger this macro using a hot key of your choosing after first placing your mouse pointer over the first vertical line where you want the first stamp to appear. Then just keep using the hot key until you’ve done all the stamps you want.

Additionally, if there are a fixed number of vertical lines - say N - you could wrap the above two steps in a Repeat N Times action loop. Triggering it would then apply N stamps for you.

Does that help at all?

Thank you for your help. I have about 10 pixels between the black lines. The idea is that I can hold a hotkey and I maneuver the mouse cursor any variable height (y-axis) and when it travels a distance of 10 pixels on the (x-axis) the enter key will trigger. I’m not sure what actions to set this up.

No problem. Maybe you’ll get a better response to your other post. One thing I’ll suggest is this: provide before and after examples of the documents you are working with as it's difficult to imagine what it is you are actually doing!

Thank you Tiffle. I will try to explain a little better. I have a PDF and every time the mouse cursor crossed the vertical line I want the left mouse to click. They are evenly spaced apart.


I've made a macro for you to use as a basis for what you want to achieve. Mouse Monitor Test.kmmacros (7.0 KB)

It looks like this:

I don't have time to explain it but there are plenty of comments that you should be able to work out what's happening.

The macro is triggered by the press of a hot key and then continues to function until you press escape. You can set these keys to be whatever suits you. You do not need to hold any keys down while the macro is running.

At the moment the macro monitors how far the mouse has moved and then performs an action when it has moved so many pixels. The action I have implemented is playing a sound - you will want to change this to an action that generates a stamp (may be a click of the mouse or the press of a key - that's an exercise for you to work out?)

Remember - once triggered the macro runs until you press the escape key. Don';t forget that!

Disadvantages;

  1. It goes on mouse position and not background colour so if you get the spacing wrong, your “stamps” will be in the wrong places.
  2. Make sure you move the mouse not too quickly.

Look at the macro, read the comments and good luck!

By the way, this macro took me 15 minutes to create and this post about 30 minutes!

1 Like

Wow, this works great! Thank you!! I appreciate your help, and your comments are perfect.