1 #import <AppKit/NSWindowScripting.h>
2 #import <AppKit/NSApplication.h>
4 @implementation NSWindow(scripting)
6 -(NSInteger)orderedIndex {
7 NSInteger result=[[NSApp orderedWindows] indexOfObjectIdenticalTo:self];
9 /* Documentation says orderedIndex is zero based, but tests say it is 1 based
10 Possible there is a window at 0 which is not in -[NSApp windows] ? Either way, available windows are 1 based.
12 if(result!=NSNotFound)