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

 
How can I enter text into the Note field of existing item with AS? Thread Tools Search this Thread Display Modes
Hello,

Here's what I hope is a simple question for someone:

How can I enter text into the note field of selected action item with AppleScript? I'm thinking of something along the lines of:
set note of itemX to "Some Text"

I can easily do it with a parsing command for an item I am creating, but I don't see in the dictionary how to do so for an already existing item, and multiple attempts have yielded nothing useful. I would like to know how to do it for a selected item, and if the syntax is different for a non-selected item, then for that as well. I can't imagine that the answer should be very complicated, so I hope someone can take a minute to answer me.

Thanks a lot.

MB
 
Well, you've actually got exactly the statement you need to do what you want. The tricky part is getting your hands on the selected item!

Here's a sample script that will append a string to the notes field of the selected items. Note that it does not drill down into contained items.

Code:
tell application "OmniFocus"
	tell front document
		tell (first document window whose index is 1)
			set theSelectedItems to selected trees of content
		end tell
		repeat with i from 1 to count of theSelectedItems
			set selectedItem to value of item i of theSelectedItems
			set theName to name of selectedItem
			set theNote to note of selectedItem
			set theNote to theNote & "
This is a note inserted in " & theName
			set note of selectedItem to theNote
		end repeat
	end tell
end tell
 
Thanks a million!
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add a note to an existing item? alex weber OmniGraffle General 0 2011-06-06 04:04 AM
Can't enter any text in Title field cosmo OmniFocus for iPhone 9 2010-11-07 11:41 AM
Add a note to an existing item? carlsson OmniGraffle General 0 2008-10-16 01:49 AM
Cannot enter sync details on existing DB Tim Harris OmniFocus Syncing 2 2008-08-17 11:29 PM
How do you enter note with keyboard (what used to work doesn't) ptone OmniFocus 1 for Mac 2 2007-12-14 10:40 AM


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


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