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

 
Delete paragraph from rich text Thread Tools Search this Thread Display Modes
Hello

This is actually an applescript problem, but Omnifocus related.

I like to delete a line (paragraph) from a task's note. Here is the method:

Quote:
on removeTotal(myNote)
set myLines to paragraphs of myNote
repeat with i from (count myLines) to 1 by -1
if item i of myLines contains mySpentMark then
tell myNote to delete paragraph i
end if
end repeat
end removeTotal
tell myNote to delete paragraph i

is the line that doesn't work. I get the message: "The note as text" doesn’t understand the delete message.

I tried quite a number of syntax variations, this one I took from a TextEdit example. The rich text class understands delete, is myNote not a rich text anymore? But it understands paragraphs !?

Here is the complete script:

http://pastebin.com/m55cd8e7c

Thanks for any hint!

Best,
Ganwell
 
I found the error by myself. The set-command somehow converted the note. I passed the container of the note to the event and it works:

Code:
	on removeTotal(myContainer)
		set myLines to paragraphs of note of myContainer
		set myCount to count of myLines
		
		repeat with i from myCount to 1 by -1
			if item i of myLines contains mySpentMark then
				tell note of myContainer to delete paragraph i
			end if
		end repeat
	end removeTotal
Best,
Ganwell
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Examples of using Rich Text in applescript jcater OmniFocus Extras 1 2008-02-09 02:38 AM
Rich text notes. papaverfugue OmniFocus 1 for Mac 7 2007-07-12 03:13 PM
Rich text and Palm sync dopeelf OmniFocus 1 for Mac 2 2007-06-01 06:05 PM
Rich Text Support mija OmniWeb Feature Requests 1 2007-03-05 05:06 PM
Rich text editor for forums Stashie OmniWeb Feature Requests 1 2006-10-24 01:44 PM


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


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