There's no problem accessing a window by its (application specific!) ID by AppleEvents / AppleScript.
(Must have been decades since you last opened Script Editor, Uli :-) ).
Of course this depends on the application supporting AppleEvents...

Just run this script in Script Editor:

tell application "<otherApplication>"
        properties of every window
end tell

Look at the result to see whether there´s an ID property.

Since I guess Benedict is working in the sphere of Accessibility anyway, it might indeed be more appropriate to just call AXRaise on the AXWindow element. The reason I proposed AppleEvents was because he was asking for adressing the window by its ID.


Am 28.02.2011 um 10:33 schrieb Uli Kusterer:


On 27.02.2011, at 13:55, Benedikt Iltisberger wrote:

But how can I now set the selected window ID to front?

(Note: It is a window of a foreign application which I want to set to front. My own app wouldn't be a problem.)


Not sure you can use that information for anything (I don't think AppleScript deals in Window IDs, but that may have changed since I last had to put up with it). You may have more luck using the accessibility APIs to both list the windows and then bringing one to front.

Cheers,
-- Uli Kusterer
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to