Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Xino

macrumors member
Original poster
Sep 5, 2008
36
0
A NSWindow object has a representedFilename property which I would like to access via another application.

I'm able to access the window name of another application by using the Accessibility API via the following code:

err = AXUIElementCopyAttributeValue( frontMostWindow, kAXTitleAttribute, (CFTypeRef *)&windowName);

As said, this code is giving me the window name but I would like to have the represented filename property of the same window. I tried most constants described here: http://developer.apple.com/library/...vel/AXAttributeConstants_h/CompositePage.html but they doesn't provide me with usable data.

Also I tried UIElementInspector to find out if this information is available but also without success.

Is this even possible? Otherwise is it somehow possible to "cast" an AXWindow or CGWindow object to a NSWindow object?
 
I don't know if this helps, but the Notes specific to Mac OS X 10.3 section of the Developer Release Notes: Cocoa Application Framework (10.6 and earlier) says:
AXWindow's title attribute used to include the path name for windows with represented files (as per [NSWindow title]). This has now been fixed so they only return the displayed title. You should access the represented file with the AXDocument attribute.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.