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

 
Select Random Action Thread Tools Search this Thread Display Modes
http://forums.omnigroup.com/showpost...03&postcount=1

Quote:
Originally Posted by jpepper View Post
An open request to a code jockey with some free time...

I'm looking for a script that will choose a random next action for me. Sometimes, I need a little help getting started. It would be great if there was a magic script that would choose an action for me at random.

This would help me with motivation in the morning and also increase the likelihood that one of my neglected projects would get attention.

Thanks!
I looked to see if anyone else had created a random action selector script, but couldn't find one on the forum.

I am very new at AppleScripting, and it shows, but here is a simple script to pick a random action from a list.

I borrowed most of the code from Snarke's "new Task to iCal" script. Feel free (anybody) to change or improve it.
Attached Files
File Type: zip OF Random Action.zip (4.0 KB, 291 views)

Last edited by dhm2006; 2007-10-15 at 07:51 AM..
 
Thanks, dmh! I'm going to try it out in a little while. I definitely appreciate your time and effort. Thanks again.
 
My script editor crashes when trying to open the script. Can you post the program code or save it in plain text AppleScript?

Thanks
Stefan
 
Quote:
Originally Posted by Schimmi View Post
My script editor crashes when trying to open the script. Can you post the program code or save it in plain text AppleScript?
Sure.

Code:
-- Purpose: To select random action from list
-- NOTE:  Most of the code is borrowed from snarke's "New Task to iCal" script.

-- Display directions

display dialog "Preparation:

1.  Open OmniFocus.
2.  Select (highlight) actions for the list.
3.  Press OK.

A random action will be displayed -- three times.  Choose one and go for it!" with title "Select Random Action from List"

-- Create empty list

set newTaskList to {}

tell application "OmniFocus"
	
	-- Set variables
	set theDoc to document window 1 of document 1
	set TaskList to the value of the selected tree of the content of theDoc
	
	-- Add selected tasks to list	
	repeat with theSelectedTask in TaskList
		set newTask to the name of theSelectedTask
		set end of newTaskList to newTask
	end repeat
end tell

-- Display result

repeat 3 times
	display dialog some item in newTaskList
end repeat
 
I wonder if there's a way to prevent it from selecting any grouping titles as items.

(I had my standard view of work contexts grouped by context, with all selected (via Cmd-A), and one of my random "actions" was "email.")
 
Quote:
Originally Posted by Craig View Post
I wonder if there's a way to prevent it from selecting any grouping titles as items.

(I had my standard view of work contexts grouped by context, with all selected (via Cmd-A), and one of my random "actions" was "email.")
I dont know. The part of the code that creates the list was written by Snarke. Maybe someone who knows more about Applescript and the OmniFocus Scripting Dictionary can help.

Edit: The script seems to work better if the actions are not grouped.

Last edited by dhm2006; 2007-10-19 at 11:24 AM..
 
I adapt this script OF Random Action utilizing Curt Clifton script named What are you doing? (see http://forums.omnigroup.com/showthread.php?t=4947)
because I prefer that my random task to be show in a growl message rather a dialog box.
This script show just 1 random task rather 3.
Do not forget to select tasks before use this script.
Thanks.
Attached Files
File Type: zip OF Random Action.zip (4.3 KB, 236 views)
 
This is the enough information for anyone from omnigroup.
 
I have never created random but I am thinking to try for it.I would like to appreciate you for your hard work.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to duplicate tasks? [A: tap & hold on the action, then select from popover.] nicoledb OmniFocus for iPad 6 2013-04-23 10:29 PM
Column width not modifiable [A: Select an action & hover over col. boundary] jochen OmniFocus 1 for Mac 1 2009-08-09 09:48 AM
Random Redirects to A Random Website OmniDazzler OmniWeb Bug Reports 2 2009-07-09 11:41 PM
Random Next Action jpepper OmniFocus 1 for Mac 4 2007-10-16 01:20 PM


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


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