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 > Developer > AppleScripting Omni Apps
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Omni code golf Thread Tools Search this Thread Display Modes
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:

Code:
tell application id "OOut" to tell row 1 of document 1 to move it to end of children
OmniFocus comes in next at 92:

Code:
tell application id "OFOC" to tell flattened task 1 of document 1 to move it to end of tasks
OmniPlan is a harder challenge - the following code does not crash the application, but does seem to unexpectedly eliminate a task.

Code:
tell application id "OPla" to tell task 1 of document 1 to move it to end of tasks
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:

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
(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).

--

Last edited by RobTrew; 2011-03-30 at 12:25 PM..
 
Nice work. Misbehaviors all reproduced and written up. Thanks!
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
I code with a Strict Doc type ... mergatroid OmniWeb Feature Requests 2 2008-01-28 07:39 AM


All times are GMT -8. The time now is 01:55 PM.


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