The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   A strange new bug in OF applescript [A: Script Debugger issue, not OF's.] (http://forums.omnigroup.com/showthread.php?t=22104)

RobTrew 2011-09-10 02:04 AM

A strange new bug in OF applescript [A: Script Debugger issue, not OF's.]
 
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 [I]current date[/I] falls somewhere within [I]tell front document ... end tell[/I]

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
[/CODE]

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[/CODE]

RobTrew 2011-09-10 08:04 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[/CODE]

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[/CODE]

Brian 2011-09-12 03:44 PM

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.

whpalmer4 2011-09-12 03:57 PM

Yep, Mark has confirmed plans for a fix in SD 5.0 later this year.

Brian 2011-09-12 03:59 PM

Thanks - if I was mis-remembering where the issue was, wanted to make sure this had been written up.


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

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