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 1 for Mac
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Append paragraph to task's note via AppleScript Thread Tools Search this Thread Display Modes
I can't seem to figure out how to append a paragraph to an OmniFocus task's existing note in AppleScript without affecting any existing rich content. A couple of online resources suggest something like "copy note & "stuff" to note" but that removes all formatting.

I can set the entire contents of a note with "copy "foo" to note of [task]". I can even replace an existing part of the note that way, e.g. "copy "foo" to last paragraph of note of [task]" works.

However, if I want to add to the end of a note, there's no easy way: "copy "foo" to end of note of [task]" results in "OmniFocus got an error: Canít set last insertion point of note of [task] to \"foo\"." "copy "foo" to the end of paragraphs of [task]" gives a similar error.

I can "copy [paragraph] to end of note". However, if the note is a single-line note to start with, that doesn't create a new paragraph to change, so it's not very helpful for my purposes.

"insert "foo" at end of note" results in "OmniFocus got an error: Canít make or move that element into that container."

I also tried duplicating the last character, and then copying some text over that. That almost works, except that the text inserted inherits the styles of the character that was duplicated, and I want the text to have the default styling. Is there any way to clear the formatting of a part of the text?

In summary: Is there a straightforward way to append text to a note without messing up formatting?

Last edited by waltermundt; 2010-07-20 at 08:17 AM..
I'd rather this was simpler, but you can do it like this: (presume you're in a 'tell [task]' block for convenience):
copy note's last character to end of note
set note's last character's style to missing value
set note's last character to "\nNew line of text here"
Of course, if there's no note to begin with, this won't work. However, in that case you can just set the note to whatever you want.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Modifying project's note via applescript not updated in display: MVC bug? fudster OmniFocus Extras 0 2010-03-01 09:37 AM
clip or append to project note field steve OmniFocus 1 for Mac 5 2009-10-13 04:15 PM
Append to OmniOutliner from LaunchBar? bongoman OmniOutliner 3 for Mac 8 2009-06-29 11:12 PM
An Applescript to convert a note to a child rowÖ Cornelius OmniOutliner 3 for Mac 4 2009-01-28 09:27 AM
A note to the brave (AppleScript and Betas) Lizard OmniPlan General 0 2007-03-21 12:33 PM

All times are GMT -8. The time now is 09:37 AM.

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