1 person found this helpful
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.
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?
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.
Look at LayoutWindow.bounds -- "The bounds of the window (specified in pixels) in the form [top, left, bottom, right]."
What's he suposed to do with that information?
I've used Window bounds to zoom specific amounts, etc. But it's going
to be a real hack to try to get something placed and sized correctly
based on this info...
Yeah, well, it could be useful if you got the coordinates from Applescript, wouldn't it? A translation from screen to document? I'm not AS savvy enough to try it.
Window bound will get you from screen to window, but you still have to work out where the page of the document is in terms of the window.