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 Today's Posts

 
Add Text to the Start of an Action Thread Tools Search this Thread Display Modes
Is there a way to add text to the start of an OmniFocus action? I have various notes that I put at the start of actions like "Couldn't Do: Get Milk", "Delegated:Get Milk", "Forward:Get Milk", "Dropped:Get Milk" etc. It would be great if I could run a script on several actions to do this at once.

I've spent the last half hour trying to find a way to do this on the forums but no luck.
 
Sure, with help from Applescript!

See FAQ: Installing & running an OF applescript for details on how to install the attached script. Once you've got it installed, just select a bunch of actions, invoke the script, give it the string to prepend, and you're off to the races!
Attached Files
File Type: zip Prepend text to selected actions.scpt.zip (3.2 KB, 520 views)

Last edited by whpalmer4; 2011-09-13 at 07:29 AM.. Reason: Update corrupted script
 
Hi whpalmer4,

Thanks for posting up a solution. However, I installed the script and it appears to be corrupted. It neither works (error "null") nor can be opened in script editor which to me is a sign there is something wrong ;) Can you check if it's actually working for you (this very file)?

I'm on OF 1.9.3, running on Lion.

Thanks,
Christ
 
This is awesome! Thank you very much, I will try to modify it to always do the same text every time. Especially since I only have about 5 things I attach to the start of actions at the end of the day.

Christian follow the directions in the link whpalmer4 posted and it should work for you. I was thinking that I would have to open the script, and change the text that was there but the script has you type in the text you would like to add each time you run it so it is flexible for anyone that doesn't want to open a script.

It didn't open for me either just so you know.

Code:
--Prepend text to select actions
tell application "OmniFocus"
	tell front document
		tell document window 1
			set oTrees to selected trees of content
			set IngTrees to count of oTrees
			if (IngTrees > 0) then
				set strPrepend to text returned of (display dialog "String to prepend to selected actions" default answer "" buttons {"OK", "Cancel"} default button "OK")
				
				repeat with iTree from 1 to IngTrees
					set oTask to value of (item iTree of oTrees)
					set name of oTask to strPrepend & name of oTask
				end repeat
			else
				display alert "No content selected!"
			end if
		end tell
	end tell
end tell
Thanks again, I will be using this everyday instead of my half-baked QuicKeys action I was running.
Attached Thumbnails
Click image for larger version

Name:	Screen shot 2011-09-13 at 9.37.44 AM.png
Views:	575
Size:	26.6 KB
ID:	2015  
Attached Files
File Type: zip Prepend text to selected actions.scpt.zip (3.1 KB, 544 views)
 
Figured out the first thing I wanted to to. Something else though: hoe do I have to modify the code to have it automatically capitalise the first letter of the first word entered into the dialog box?

For example, I enter "waiting for" -> scripts adds "Waiting for" to the task.

Last edited by Christian; 2011-09-13 at 07:21 AM..
 
Quote:
Originally Posted by Christian View Post
Figured out the first thing I wanted to to. Something else though: hoe do I have to modify the code to have it automatically capitalise the first letter of the first word entered into the dialog box?

For example, I enter "waiting for" -> scripts adds "Waiting for" to the task.
I would check out:

http://www.ettoresoftware.com/products/typeit4me/

http://startly.com/products/quickeys/mac/4/

http://www.ergonis.com/products/typinator/

http://www.smilesoftware.com/TextExpander/

Obviously you are trying to do this with AppleScript only but I don't know other than those apps or holding down the shift key :).
 
Thanks for recompiling and reposting, skillet. Maybe Script Debugger was having a bad day when it compiled for me. I agree the compiled script in my original post doesn't appear to run after downloading it, so I installed a fresh copy and verified that it works here (at least on Snow Leopard).
 
 




Similar Threads
Thread Thread Starter Forum Replies Last Post
Unwanted Loc. reminders now for an action due in Jan [A: add start date to action] jman995x OmniFocus for iPhone 4 2011-12-01 01:39 PM
Should I start with the Text Editor example? gopi Omni Frameworks 4 2010-09-14 10:28 PM
Action status: "next action" and start dates dondo OmniFocus 1 for Mac 3 2008-08-06 08:48 PM
Start / end of line key nav inside text object ? Leon Starr OmniGraffle General 2 2008-07-02 12:11 PM
Possible to search Action text containing text value? Journey OmniFocus 1 for Mac 3 2007-11-28 03:25 PM


All times are GMT -8. The time now is 06:13 AM.


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