The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
A strange new bug in OF applescript [A: Script Debugger issue, not OF's.] Thread Tools Search this Thread Display Modes
whpalmer4 has alerted me to the fact that at least one of my scripts, which used to work fine, has started to trip an error message where current date falls somewhere within tell front document ... end tell

And the bug is a subtle one - one of the following sequences trips an error, but the other doesn't ...

ERROR:
Code:
-- WORKS IF RUN AFTER THE OTHER TWO, 
-- BUT FAILS IF RUN BEFORE THEM, OR IN A SCRIPT ON ITS OWN
tell application "OmniFocus"
	tell front document
		current date
	end tell
end tell

-- WORKS
tell application "OmniFocus"
	set oDoc to front document
	tell oDoc
		current date
	end tell
end tell

-- WORKS
tell application "OmniFocus"
	tell default document
		current date
	end tell
end tell
NO ERROR:
Code:
-- WORKS
tell application "OmniFocus"
	set oDoc to front document
	tell oDoc
		current date
	end tell
end tell

-- WORKS
tell application "OmniFocus"
	tell default document
		current date
	end tell
end tell

-- WORKS IF RUN AFTER THE OTHER TWO, 
-- BUT FAILS IF RUN BEFORE THEM, OR IN A SCRIPT ON ITS OWN
tell application "OmniFocus"
	tell front document
		current date
	end tell
end tell

Last edited by RobTrew; 2011-09-10 at 02:07 AM..
 
Or perhaps an OS X change ?

Error:
Code:
-- WORKS IF RUN AFTER THE FOLLOWING CODE, 
-- BUT FAILS IF RUN BEFORE IT, OR IN A SCRIPT ON ITS OWN
tell application "TextEdit"
	tell front document
		current date
	end tell
end tell

-- WORKS
tell application "TextEdit"
	set oDoc to front document
	tell oDoc
		current date
	end tell
end tell
Reversed sequence --> no error:
Code:
-- WORKS
tell application "TextEdit"
	set oDoc to front document
	tell oDoc
		current date
	end tell
end tell

-- WORKS IF RUN AFTER THE PRECEDING CODE, 
-- BUT FAILS IF RUN BEFORE IT, OR IN A SCRIPT ON ITS OWN
tell application "TextEdit"
	tell front document
		current date
	end tell
end tell

Last edited by RobTrew; 2011-09-10 at 08:11 AM..
 
Rob, I think I saw your support ticket go by this morning, but I don't remember which ninja ended up getting it. You eventually tracked this down to a problem with Script Debugger, correct?

Just wanted to double-check.
 
Yep, Mark has confirmed plans for a fix in SD 5.0 later this year.
 
Thanks - if I was mis-remembering where the issue was, wanted to make sure this had been written up.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Perspective url strange behavior (language issue?) stzenni@me.com OmniFocus 1 for Mac 0 2013-03-28 03:41 PM
Omnigraffle 5.4 - Apple Script Font Issue marxes OmniGraffle General 6 2012-06-13 09:17 AM
Strange Location issue... simoncg OmniFocus for iPhone 5 2008-09-03 01:38 AM
Strange Spaces Applescript bug dmwatlse OmniFocus Extras 0 2008-05-08 06:30 AM
Be cautious with Script Debugger & current SneakyPeek builds RobTrew OmniFocus Extras 1 2008-02-16 09:55 AM


All times are GMT -8. The time now is 05:06 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.