View Single Post
Traditional references to the 'front window' of Omni apps will now fail on Lion if it is in full screen mode.

The case of OmniFocus has been helpfully dealt with in this post, which suggests:

Code:
tell application "OmniFocus"
    tell first document window of front document
      ...
    end tell
end tell
I think that the following approach should work for OmniGraffle and OmniOutliner in both 10.6 and 10.7 (full screen or otherwise).

Code:
set winOG to GetFrontWin("OGfl")

set winOO3 to GetFrontWin("OOut")


on GetFrontWin(strAppID)
	tell application id strAppID
		if my isFullScreen(strAppID) then
			window 2
		else
			window 1
		end if
	end tell
end GetFrontWin

on isFullScreen(strAppID)
	tell application "Finder" to set blnPreLion to (version < "10.7")
	if blnPreLion then
		return false
	else
		tell application id "sevs"
			set lstApps to application processes where creator type = strAppID
			if length of lstApps < 1 then return false
			set lstWins to windows of first item of lstApps
			if length of lstWins < 1 then return false
			return value of attribute "AXFullScreen" of item 1 of lstWins
		end tell
	end if
end isFullScreen