Skip to main content
Participant
December 17, 2009
Question

[JS] Get Mouse Cursor Position

  • December 17, 2009
  • 1 reply
  • 3166 views

I have looked through the documentation and forums here and haven't found any reference to getting the cursor mouse position. I see info about text cursor position, but I am looking to capture the coordinates of mouse position. Is that possible with JavaScript (ExtendScript)?

Thanks for any help you can offer.

Dan

This topic has been closed for replies.

1 reply

December 17, 2009

Hi Dan,

Sorry, there's not a way to do that with InDesign scripting.

What are you trying to do that you need this? It might be possible to do what you want via some other approach.

Thanks,

Ole

danrodneyAuthor
Participant
December 17, 2009

I want the script to create a specific sized picture frame on the page. It would be cool to make it at the current mouse position. Yes I can draw the frame myself, but I am trying to automate a tedious process, so having the script create the frame with all the proper options such as size and style will speed things up. I can create it in the middle of the page with the script, and then drag it into position manually, but it would be even better to use the mouse position when the script creates the frame.

Maybe an AppleScript could get the mouse position?

But then how would I pass that to my JavaScript?

Inspiring
December 17, 2009

You can get the position indirectly via AppleScript, however that's going to be the position in screen coordinates -- I'm not sure how you're going to convert that to coordinates in the document you have open.