The scriptability of Omni apps is excellent, and I find that it makes them really invaluable.
Even excellence benefits from a challenge, of course, and in honour of the ancient tradition of Perl golf I have just taken a round of some of the Omni Apps, in search of the shortest applescript program that can solve a particular problem.
The obvious starting problem is simply a test of robustness - what is the smallest number of characters that can be used in Applescript to crash the application ?
At the moment OO3 (my favourite application, as it happens) is leading the field with just 84 characters:
OmniFocus comes in next at 92:
OmniPlan is a harder challenge - the following code does not crash the application, but does seem to unexpectedly eliminate a task.
OmniGraffle Professional 5 comes in last in the race to crash, and, perhaps most robustly and impressively of all, actually generates an error message OmniGraffle Professional 5 got an error: AppleEvent handler failed. in response to the following:
(All of the above assume that there is a document containing at least one row task or shape, and the OG code assumes that Shape 1 has an incoming line).
(Disclaimer - I do not advise the testing of any of these code snippets - they may cause loss of data).
--
Even excellence benefits from a challenge, of course, and in honour of the ancient tradition of Perl golf I have just taken a round of some of the Omni Apps, in search of the shortest applescript program that can solve a particular problem.
The obvious starting problem is simply a test of robustness - what is the smallest number of characters that can be used in Applescript to crash the application ?
At the moment OO3 (my favourite application, as it happens) is leading the field with just 84 characters:
Code:
tell application id "OOut" to tell row 1 of document 1 to move it to end of children
Code:
tell application id "OFOC" to tell flattened task 1 of document 1 to move it to end of tasks
Code:
tell application id "OPla" to tell task 1 of document 1 to move it to end of tasks
Code:
tell application id "OGfl" to tell incoming line 1 of shape 1 of canvas 1 of document 1 to move it to end of incoming lines
(Disclaimer - I do not advise the testing of any of these code snippets - they may cause loss of data).
--
Last edited by RobTrew; 2011-03-30 at 12:25 PM..