View Single Post
Quote:
Originally Posted by ryans View Post
Interestingly, the export doesn't appear to be happening if visible is set to false.
When a window is made invisible, the Applescript interface to it is destroyed and has to be recreated. This is a bug which I reported [OG #556132] when writing my Where in OF script, which resorts to workarounds at more than one point. (Likewise the 'Home Page' toolbar button)

I think Tim indicated that he had some insight into why this might occur. My guess is that it is relevant to the problems described in this thread.

A simple illustration:
Code:
tell application id "com.omnigroup.omnifocus"
	tell default document
		set oWin to make new document window
		display dialog (id of oWin) as string with title "id of new Window"
		
		set visible of oWin to false
		display dialog (id of oWin) as string with title "id of new Window once invisible" -- fails.
		
	end tell
end tell

Last edited by RobTrew; 2012-07-17 at 07:13 AM.. Reason: Updated link to Where in OF