Is the object fixed by using the default top, left auto-resize anchors or will its position change as the window size changes?
If it is fixed, you can pass the needed data as a script parameter that you specify for the button. (Clicking a button does not make it the active object.)
If this a button in a portal or the body of a list view, it get's a bit more complicated. The active portal row number can be used to adjust the postion for a portal, but a list view might be problematic as there is no way to detect the scroll posiiton of the window.
Actually the reason I said that there are many objects on the layout is the following.
The layout is actually a list view, there are 7 objects across and of course they repeat with the list. These objects are anchored to left.
Each of these objects is an actual table field but I also assigned it a button definition to run a script called "clickcell" and that script does the rest of the work like opening the pop up window etc.
I can pass the left coordinates of each of the 7 objects across in the script parameter but of course the top is unknown unless there is a function to tell me where am I on the layout.
I also forgot to say that these 7 objects are read only
Then you have a problem as there is no way from just FileMaker functions to determine the scroll position of your window and thus the height remains an unknown quantity.