Way to detect window position on Mac?

BlitzMax Forums/BlitzMax Programming/Way to detect window position on Mac?

if my other code worked, then this might also:

#Import <AppKit/AppKit.h>

NSPoint getWindowX(){

    NSApplication *myApp = [NSApplication sharedApplication];

    NSWindow *myWindow = [myApp keyWindow];
	NSRect myFrame = [myWindow frame] ; 
	NSPoint theOrigin = myFrame.origin;
	Return theOrigin;
};