The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniPlan General (http://forums.omnigroup.com/forumdisplay.php?f=37)
-   -   How to crash OmniPlan with one line of Applescript (http://forums.omnigroup.com/showthread.php?t=16530)

RobTrew 2010-06-17 02:19 PM

How to crash Omnifocus with one line of Applescript
 
If you want to automatically close a large number of windows opened in OmniFocus, you might be tempted to write a single line of Applescript like this:

[CODE]tell application "OmniFocus" to close windows[/CODE]

This does indeed work well if you run it from the OmniFocus script menu, or from a script editor.
If, however, you [URL="http://forums.omnigroup.com/showthread.php?t=7453"]install a button for it on the OF toolbar[/URL], this innocuous script becomes a danger - it is likely (more than 7 times out of 10 on my system, for example) to crash OF completely.

This is symptomatic of a general defect in the applescript-launching mechanism of omni toolbars - some scripts behave incorrectly when run from the toolbar, others exit with error messages, even though they run perfectly well from the application's script menu.

I first drew attention to this particular crasher two years ago.
As the toolbar applescript-launching mechanism has again proved frustrating with a couple of recent scripts, I tested the issue again in the last few days. Troy has just written to say: [I]this is a known issue that we have filed in our database. I'll add your vote to the list so we know you'd like to see it fixed![/I]

Analogous scripts also crash OmniPlan and OmniOutliner (I had thought OmniOutliner was fixed, but it has just crashed on me ...).

If, like me, you find it helpful to install applescripts on the OF toolbar, find crashing disconcerting, and would like to see this issue (and the general launching of applescripts from the toolbar) fixed, do use [B]Help > Send Feedback[/B] in the OF menu, and let the OF development team know ...

[COLOR="White"]--[/COLOR]

whpalmer4 2010-06-17 10:00 PM

[QUOTE=RobTrew;78826]
If, like me, you find it helpful to install applescripts on the OF toolbar, find crashing disconcerting, and would like to see this issue (and the general launching of applescripts from the toolbar) fixed, do use [B]Help > Send Feedback[/B] in the OF menu, and let the OF development team know ...
[/QUOTE]

Maybe it's just my background as an O/S and networking engineer speaking, but I've always considered any bug that causes a program to crash when presented with well-formed input or proper operation to be a bug that has a very high priority for fixing by default. I can see lowering that priority if the crash is caused by a truly unusual set of events or actions or the fix is too destabilizing, but in general, more people will suffer from a crasher than will report it, and one so easily reproducible ought to be fixed at least to the point where no crash takes place, and any reduced functionality documented. In my experience, the unspoken feature request at the top of everyone's list is "Program should not crash!"

RobTrew 2010-06-17 10:53 PM

[QUOTE=whpalmer4;78842]Maybe it's just my background as an O/S and networking engineer speaking, but I've always considered any bug that causes a program to crash when presented with well-formed input or proper operation to be a bug that has a very high priority for fixing by default. [/QUOTE]

I absolutely agree with you.

I also think that the location of this crash-inducing defect in code that is shared between several Omni products (and prevents the correct execution of scripts that work perfectly well from script menus) means that any time and thought devoted to it will have very useful leverage.

Perhaps crashers and shared code are a slight blind patch in the generally rational system of simply counting votes ?

macula 2010-06-17 10:57 PM

Yes! Likewise, I have often found it impossible to run scripts from the OmniOutliner toolbar, whereas the same scripts always work fine from the scripts menu or even the Finder.

RobTrew 2010-06-17 11:38 PM

How to crash OmniPlan with one line of Applescript
 
If you want to automatically close several windows opened in OmniPlan, you might be tempted to write a single line of Applescript like this:

[CODE]tell application "OmniPlan" to close windows[/CODE]

This does indeed work well if you run it from the OmniPlan script menu, or from a script editor.
If, however, you [URL="http://forums.omnigroup.com/showthread.php?t=7453"]install a button for it on the OP toolbar[/URL], this innocuous script becomes a danger - it is likely to crash OP completely, particularly if you change focus to another app just after running, it seems.

This is symptomatic of a general defect in the applescript-launching mechanism of Omni toolbars - some scripts behave incorrectly when run from the toolbar, others exit with error messages, even though they run perfectly well from the application's script menu.

I first drew attention to this particular crasher two years ago.
As the toolbar applescript-launching mechanism has again proved frustrating with a couple of recent scripts, I tested the issue again in the last few days. Aaron has just written to say: [I]I'll file this in our bug database for consideration.[/I]

Analogous scripts also crash OmniFocus and OmniOutliner (I had thought OmniOutliner was fixed, but it has just crashed on me ...).

If, like me, you find it helpful to install applescripts on the OP toolbar, find crashing (and misbehaving scripts) disconcerting, and would like to see this issue fixed, do use [B]Help > Send Feedback[/B] in the OP menu, and let the OP development team know ...

[COLOR="White"]--[/COLOR]

Ken Case 2010-06-17 11:47 PM

This crash has been fixed in the most recent sneaky peek build.

RobTrew 2010-06-18 12:15 AM

[QUOTE=Ken Case;78854]This crash has been fixed in the most recent sneaky peek build.[/QUOTE]


Excellent !

Thank you Ken, I really appreciate your putting time into this, an enormously welcome change ... (not just the elimination of crashing, but the correction of global variable persistence too).

(I really look forward to this propagating, before too long, into the toolbar applescript-launching code of OmniPlan, and especially, OmniOutliner 3)

Thank you again for this swift solution,

Rob

[COLOR="White"]--[/COLOR]

RobTrew 2010-06-18 12:26 AM

Ken Case has just fixed this problem, in the last few hours, for the latest sneaky-peek build of OmniFocus.

As I believe that the problem resides in code that is shared between several Omni applications, I hope that the fix will propagate, before too long, to OmniPlan ...

Brian 2010-06-18 10:28 AM

I understand that you were trying to do something positive here, but please don't create multiple forum threads on the same topic. I really don't want to set an example for other folks to use for less-savory purposes.

Merged threads.

RobTrew 2010-06-18 11:27 AM

Hi Brian,

I think I know what you mean, and the code is certainly shared, but a fix for OmniFocus does not automatically (or immediately) entail a fix for OmniPlan ...

Or are you, perhaps, saying that OmniPlan will now benefit from the work that was done on OmniFocus ?

Brian 2010-06-18 12:13 PM

I'm saying that this would be better handled via email rather than creating multiple forum threads. Once folks think it's a good idea to make many threads to try and get our attention, the forums become a lot less useful to the community.

RobTrew 2010-06-18 02:03 PM

Yes, I can understand that concern.

In this case, of course, there were two (in fact three) different applications, each with different user communities. You will know more than I do about the extent to which they all overlap, but intuitively speaking, the Omniplan forum did not seem the obvious route through which to reach Omnifocus users ... Similarly, the OmniFocus forum did not seem an ideal vehicle for communicating with Omniplan users ...

Anyway, I am very grateful that the OmniFocus problem has now been solved. (And, of course, I do hope that that implies forthcoming solutions to the Omniplan and OmniOutliner problems. Presumably there is now no need to encourage OmniOutliner users to add to the vote count on OmniOutliner's toolbar crasher ? )

whpalmer4 2010-06-18 02:59 PM

[QUOTE=RobTrew;78895]
In this case, of course, there were two (in fact three) different applications, each with different user communities. [/QUOTE]

So why isn't the correct answer [b]four[/b] different applications? OmniGraffle users aren't expected to want to put scripts in the toolbar? Or is the thinking that no one could possibly have a large enough toolbar for the number of scripts any self-respecting geek would want? :-)

Brian 2010-06-18 03:13 PM

The fix for this problem was in the frameworks that all of our applications are built on. The version of the frameworks that OmniFocus is built on has the fix, and the fix has been pushed into the common repository.

The fix won't instantly appear in the other projects, but it does mean that they will all get it when they update the version of the frameworks their projects are built on. Each team does this periodically, when they decide the time is right.

(Shared frameworks are overall a win in terms of productivity, but you have to be on guard for unintended consequences when you update. You are, after all, moving code written for one project into a different project.)


All times are GMT -8. The time now is 07:34 PM.

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