These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Capture user mouse coordinates for use in function

AndrewAlb
Registered: Aug 16 2007
Posts: 97

I would like to write a two part function -

I would like to place on the form a series of fields that the user selects via an added menu item (common fields that are often used on similar forms).

However, right now I am just placing the fields starting at the top right corner of the current page and incrementing them down and over as necessary.

I would really like to give the user some input into where at least I start putting the fields. I would like to capture the coordinates of the first mouse click after they select the option to use as my starting rect points.

Is this possible?
Is anything like this possible?

Obviously Acrobat itself is doing that when I draw a new field, but how can I leverage that same functionality...?

any help would be greatly appreciated.

PS - this is a folder level script and can be made a trusted function if necessary.

Thanks!

Andrew D. Albrecht, MS
Solutions Developer
ING USFS

My Product Information:
Acrobat Pro 8.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
The best you'll be able to do is look at the mouseX and mouseY doc properties. The question is when? You might do something like tell the user to place the mouse in a location in the next five seconds, start a five second timer, and use whatever coordinates you end up with when the timer goes off.

George
AndrewAlb
Registered: Aug 16 2007
Posts: 97
George, thanks for your input.

That is actually an interesting idea.

I guess there is no way to add a new event listener?

What about adding menu items to the right click popup-menu?

Thanks again.

Andrew D. Albrecht, MS
Solutions Developer
ING USFS

George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Another idea might be to have the user place the mouse in the desired location, and have them use the keyboard to activate the menu item.

I would answer No to your other questions.

George
AndrewAlb
Registered: Aug 16 2007
Posts: 97
George,

another good solution - the latter one might be the winner.

Thanks for all your help today.

Andrew D. Albrecht, MS
Solutions Developer
ING USFS