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

 
Export to GMail for iPhone Thread Tools Search this Thread Display Modes
I know Ethan had a way more sophisticated version of this, and there may be others on this forum, but I've a simple script to export contexts, one per email, to Mail and then to GMail IMAP so that I can at least see my shopping list on the iPhone.
Code:
tell application "OmniFocus"
	repeat with theContext in contexts of default document
		set contextName to name of theContext
		set body to ""
		repeat with theTask in remaining tasks of theContext
			set TaskProject to containing project of theTask
			set taskLine to name of theTask & " (" & name of TaskProject & ")"
			if theTask is next then
				set taskLine to "*	" & taskLine
			else if theTask is blocked then
				set taskLine to "	(" & taskLine & ")"
			else
				set taskLine to "	" & taskLine
			end if
			
			set body to body & taskLine & "
"
		end repeat
		tell application "Mail"
			set theMessage to make new outgoing message with properties {visible:false, subject:"@" & contextName, content:body}
			close theMessage saving yes
		end tell
	end repeat
	tell application "Mail"
		set destination to (a reference to mailbox "tasks" of account "GMail")
		set newMailList to (get messages in drafts mailbox)
		set oldMailList to (get messages in destination)
		delete oldMailList
		move newMailList to destination
	end tell
end tell
I hope it comes in handy.

Duncan McGregor

Last edited by dmcg; 2008-05-08 at 02:23 PM.. Reason: Update script
 
Thanks a lot for posting this and as you said it did come in handy,I expect more of these kind of stuff from you.bye for now!
 
Awesome! Thanks Duncan. Ethan's version was far too advanced for me as I'm just getting started. Your version was spot on.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gmail links don't work on Iphone app rdelossa OmniFocus for iPhone 3 2011-03-21 09:41 AM
Export function on the iphone kroger OmniFocus for iPhone 3 2009-09-08 12:19 PM


All times are GMT -8. The time now is 04:11 AM.


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