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

 
Voice -> OmniFocus Thread Tools Search this Thread Display Modes
Fixed everything. Clip o tron required a 3 button keystroke.
 
Voice to OF via Google Voice, you shouldn't even need a smart phone for this one.

I set this up in a really round-about way, using bits and pieces I found here at the OF forum and across the net, but it works.

Important points for me were that I figured a way to speak a task with minimal clicks (so I can speak tasks while driving or biking without having to look at my iPhone to launch an app).

The basic workflow is that I voice dial myself, and after ~1 ring I get a beep. I leave a message, which GVoice transcribes and emails to me. I have a Gmail filter set up that forwards the email to a second Gmail address that I use exclusively to add tasks to OF via Mail.app. Whenever Mail.app receives a message from this Gmail account, it runs the AppleScript below, which processes the email and extracts the content of the transcribed voicemail and turns it into a task, with a link to the voicemail in question in the notes section (because Google's transcription is often pretty bad, but good enough to remind me of whatever it was). So GVoice -> Gmail1 -> Gmail2 -> Mail.app -> OF.

First, I set up my Google Voice number to skip directly to the "leave a message" beep whenever it receives a call from me. To do this, I added a new greeting called "memo" where I cut off the message as soon as I could after the "record your new message" prompt. Then I made a new "group" in GVoice (voice settings->Groups) composed of just me, forwards to: "none," greeting: "memo," Call screening: "Off." Then make sure to select "transcribe voicemails" and "email the message to:" (insert your primary Gmail address) under Voice settings -> voicemail and text.

Then, in your 1* Gmail account, set up a few filters (and a label if you want).
Filter 1, to send your voice memos to the other Gmail address (and make them read/archived/labeled so they don't clog up your inbox but are organized by a label)
Code:
Matches: from:(voice-noreply@google.com) subject:("New voicemail from [Your Name]")
Do this: Skip Inbox, Mark as read, Apply label "GVoice", Forward to [2* email address for OF stuff]
Filter 2, to take the rest of the voicemail notifications and do whatever you'd like with them, but ensure that they don't go to OF unless they're from you.
Code:
Matches: from:voice-noreply@google.com subject:"New Voicemail from" -subject:"New Voicemail from [Your Name]"
Do this: Skip Inbox, Mark as read, Apply label "GVoice"
Now, set up that 2* gmail account in mail.app, and set a rule such that all messages from that account with the subject:"New voicemail from [Your Name]" get processed by the AppleScript below, which cleans them up and imports to OF.

Code:
-- Derived from work that is copyright 2007 The Omni Group. All rights reserved.
-- Modified to work specifically with Google Voice messages.  Intended for non-profit, personal use only.

using terms from application "Mail"
	
	on process_message(theMessage)
		set theSubject to subject of theMessage
		set theContent to content of theMessage
		
		set AMPM to text -2 through -1 of theSubject
		
		set messageStart to (offset of AMPM in theContent) + 5
		set messageEnd to (offset of "Play Message" in theContent) - 3
		set task_content to text messageStart through messageEnd of theContent
		
		set message_URL to "message:<" & message id of theMessage & ">"
		set omni_note to "GVoice Memo: " & message_URL
		set theText to task_content & return & omni_note
		
		
		tell application "OmniFocus"
			tell default document
				parse tasks with transport text theText with as single task
			end tell
		end tell
	end process_message
	
	on perform mail action with messages theMessages for rule theRule
		try
			set theMessageCount to count of theMessages
			repeat with theMessageIndex from 1 to theMessageCount
				my process_message(item theMessageIndex of theMessages)
			end repeat
			
		on error m number n
			tell application "OmniFocus"
				log "Exception in Mail action: (" & n & ") " & m
			end tell
		end try
	end perform mail action with messages
	
end using terms from
So... really circuitous, but in the end it's something that works reliably, even without an internet-enabled phone, and as a bonus you can just call it with your phone's voice dialing, making it so you never have to even look at the phone.

Hope this is helpful to someone, I'll try to drop by this thread every once if anyone has any questions.
 
n8henrie, this was very helpful. Thankyou

I call my GV number from my iPhone and leave a message and then a new task appears in the OF Inbox and I haven't driven off the road. Success!
 
I'm glad you found it helpful.

I've changed things up yet again, due to a few shortcomings of the previous system. For starters, I don't use Mail.app. It was a PITA for me to get things into Omnifocus by way of Mail when I had no other reason to ever open it other than Omnifocus. I had it set to run every AM before I woke up (after setting mute so as not to awaken me with any new message sounds, although there is also a pref setting for this in the app). But it really bothered me that my voice-tasks didn't show up for up to 24 hours if Mail wasn't running.

Further, if I was AFK all day, added a voice task in the AM, and checked Omnifocus for iPhone later in the day, those tasks wouldn't appear yet.

On top of it all, if the transcript was unusable, it didn't include the audio file in the attachment (just a link to the Mail.app message). Totally unusable for iPhone, and even on my Macbook it required cranking up Mail.app.

Trying to come up with a way to improve this mess has been on my mind for a while. My main requirements for voice->OFocus still include
  1. Transcription
  2. No need to look at phone (or take out of pocket)
So that means I probably need to stick with a free phone-based solution (GVoice, reQall) so that I can use the iPhone's voice commands through the headset. That seemed to be the most limiting part; tons of 3rd party apps have great features, but not a whole lot of them have a free phone in option.

Anyway, this morning I realized that a possible solution was Dropbox + Folder actions. Sure enough, the basic setup that is now working (great) for me uses this flow:

*Call GVoice or reQall
*Message is transcribed and emailed to me
*GMail filter grabs those messages and forwards to my SendtoDropbox account, which is set to turn emails to plaintext
*Files are downloaded to my local DBox folder
*Folder action (below) processes everything

Limitations:
--While reQall conveniently includes a .wav copy and an .ics of any due dates, these filenames don't have any timestamp or anything to keep them from getting overwritten by subsequent messages if multiple get processed at once (if my Macbook was asleep, for example)
--For this reason, I suspect I may use GVoice more frequently, as the filenames contain a datestamp. While it doesn't include the .wav, it gives you a URL that links you to the message in your browser (no need to crank up Mail.app, and this will keep sync times faster). I will note that this URL has been a little hit and miss for me, not sure why.
--In order to keep compatibility with both reQall and GVoice (and avoid some processing that I'm too burnt out to mess with right now), the task title is simply set to the filename, with the transcription in the note. This means that the task titles are pretty useless
--Files other than .txt (such as the reQall .wav files) are simply thrown into Omnifocus as separate tasks. But at least they'll be there (since the script activates Omnifocus, it should upload them so they'll be in your database on all your devices).

Okay, the GMail filter. Note that to register your SendToDropbox email as a forwarding address you'll have to configure SendToDropbox to turn emails into .txt files, possibly "resend" the Gmail verification, and grap the verification number from the .txt file.
Code:
Matches: ((from:voice-noreply@google.com, subject:"New voicemail from [Me]") OR (from:post@reqall.com, subject:added:, has:attachment))
Do this: Skip Inbox, Mark as read, Apply label "GVoice", Forward to [mysendtodropboxemail@sendtodropbox.com]
The Folder Action. I'm a complete Applescript novice, so this may seem pretty sloppy, but it seems to work. Parts of it were borrowed from a script somewhere else on the forum. And note that I have it set to trash the files once processed.
Code:
on adding folder items to this_folder after receiving added_items
	
	repeat with item_ in added_items
		
		tell application "Finder"
			set file_name to (name of item_)
-- I have no use for the reQall .ics files, so I just trash them.  If you want 
-- them, keep them.
			if file_name is "reQall.ics" then
				move item_ to trash
			else
				if name extension of item_ is "txt" then
					set body to read alias (item_ as string)
					tell application "OmniFocus"
						tell default document
							set NewTask to make new inbox task with properties {name:file_name, note:body}
							activate
						end tell
					end tell
					move item_ to trash
				end if
				
				if name extension of item_ is not "txt" then
					tell application "OmniFocus"
						tell default document
							set NewTask to make new inbox task with properties {name:file_name}
							tell the note of NewTask
								make new file attachment with properties {file name:item_, embedded:true}
							end tell
							activate
						end tell
					end tell
					move item_ to trash
				end if
			end if
		end tell
	end repeat
end adding folder items to
So while far from perfect, this flow gives me voice-to-omnifocus, tasks appear in Omnifocus within a few minutes, and I never have to mess with Mail.app.

As an additional perk, I can email files directly to Omnifocus with the same script by sending them directly to my SendToDropbox address.

Last edited by n8henrie; 2011-02-21 at 03:41 PM..
 
Do you use a dedicated google voice number for this? Or the same number you use for other stuff?
 
Same number. Just set so that calls from my iPhone are send directly to voicemail (set this in Google Contacts under your contact info) and given an abbreviated "leave a message" recording.
 
The Script is not available in that folder.. Can you post the script somewhere for us to download please.. thanks

Quote:
Originally Posted by fudster View Post
I thought I'd provide a short recipe of how I got this working the other day using Twitterific, for anyone that's new to applescript. I like using Twitterific because it allows you to register a listener script that runs for every tweet in the timeline - it looks after the polling for you (like Proxi did, but no longer reliably).

1) Download Twitterific from here (it's a zip file):
http://iconfactory.com/software/twitterrific

2) Unzip the zip file. Install the Twitterific app by moving it (the file with the blue birdie icon) to your Applications folder in Finder.

3) There should be an applescript there too: ProcessTweet.scpt . Move that to the place where you keep your OmniFocus applescripts (or you could move somewhere else if you like - but modify the subsequent steps here accordingly). Mine is:

~/Library/Scripts/Applications/OmniFocus/

4) Open ProcessTweet.scpt (in its new location) in AppleScript Editor and modify the script. Find this code:

Code:
    set runSpeakingSample to true
    set runUnixShellSample to false
    set runChatSample to false
    set runMailSample to false
... and change them all to false (unless you want to play and experiment with the samples first). Immediately after this code in the script, add this:
Code:
    tell application "OmniFocus" to tell default document
        parse tasks with transport text (tweetText) without as single task
    end tell
... and save the script.

5) Open Terminal and run this command (the instructions for this are in the comments of the script - this only needs to be done once):

Code:
defaults write com.iconfactory.Twitterrific processTweetScriptPath "~/Library/Scripts/Applications/OmniFocus/ProcessTweet.scpt"
Then run Twitterific, configure it with your (private) twitter channel's userid and password, and set the preferences how you like (I have mine set so it stays out of my way and does not appear in my dock).

Notes:

  • Per the other threads mentioned here, you need to create a separate, private twitter channel for your captures. Then you can use Vlingo, Dragon, Jott (for voice captures), or any other Twitter client to create tweets that will be added to your OmniFocus inbox when Twitterific processes them on your Mac.
  • Watch out for special characters, like dollar signs, etc. They have special meaning for the parse command and can cause your capture to fail. Someday I'd like to modify the script to convert them to full words so that the capture still works. Example - if you say "five dollars" in Vlingo (or Dragon, or both - can't remember), it comes through as "$5", and the script will fail and you won't see it in Omnifocus. (Hmm, perhaps a try/catch block could at least add a task to check your timeline for what went wrong...)
Cheers...
 
Looks like they changed the download - now the zip only contains the app.

BTW in Twitterific, I've found that I need to ensure that "Automatically show window when new tweets arrive" is necessary, so that the tweets are marked as read. Else, they are re-processed when the app loads, resulting in dupes. I set it to hide the window after 10 seconds.

Here's my copy of the script (including the necessary mods):
Code:
on process_tweet(tweetId, tweetDate, tweetScreenName, tweetUserName, tweetUserUrl, tweetUserImageUrl, tweetText, tweetType)
	
	(*
		This file shows some things you can do with the AppleScript integration in Twitterrific. There are
		two steps for getting this script configured:

		
		Step 1:
		
		Before Twitterrific can run the script, it needs to know where it is located.
		
		To register this AppleScript with Twitterrific, you need to use the Terminal. If the ProcessTweet.scpt file
		is located on the Desktop, you'd use:
		
			defaults write com.iconfactory.Twitterrific processTweetScriptPath "~/Desktop/ProcessTweet.scpt"
			
		You could also use "~/Application Support/Twitterrific/ProcessTweet.scpt" or whatever else makes you happy.
	
		You only need to run this step once.
		
	
		Step 2:
		
		Once the script is registered, you can try out the samples by changing "false" to "true" in the list below:
	*)
	
	set runSpeakingSample to false
	set runUnixShellSample to false
	set runChatSample to false
	set runMailSample to false
	
	
	tell application "OmniFocus" to tell default document
		parse tasks with transport text (tweetText) without as single task
		-- synchronize
	end tell
	
	
	(*	
		Make sure to restart Twitterrific after making any changes above because the script is only loaded at startup.
		

		Uninstalling:
		
		If you decide you don't want to use the script, you can unregister it with the Terminal:
		
			defaults delete com.iconfactory.Twitterrific processTweetScriptPath			

		Have fun!
	*)
	
	if (runSpeakingSample) then
		(*
			Use the Finder to say the user name and text of the tweet that just arrived.
		*)
		tell application "Finder"
			say "Tweet from " & tweetUserName & " saying " & tweetText
		end tell
	end if
	
	if (runUnixShellSample) then
		(*
			Use the Unix shell to log your tweets in a CSV format.
		*)
		do shell script "echo \"'" & tweetId & "', '" & tweetDate & "', '" & tweetScreenName & "', '" & tweetUserName & "', '" & tweetUserUrl & "', '" & tweetUserImageUrl & "', '" & tweetText & "', '" & tweetType & "'\" >> /tmp/tweet.log"
	end if
	
	if (runChatSample) then
		(*
			Use your last tweet to update your iChat status message.
	
			This would be useful for cases where you leave your Mac running and want to update your chat status
			using SMS or the web interface.
		*)
		-- update yourScreenName to be your Twitter screen name
		set yourScreenName to "chockenberry"
		tell application "iChat"
			if (tweetScreenName = yourScreenName) then
				set status message to tweetText
			end if
		end tell
	end if
	
	if (runMailSample) then
		(*
			When a tweet arrives from Darth Vader, compose and send an email to your Mom with the contents of the tweet.
		*)
		if (tweetScreenName = "darthvader") then
			-- update theAccount to be the name of the account in Mail you want to send from
			set theAccount to "Name of your mail account"
			
			-- update this to be whatever you want the message subject to be
			set theSubject to "Tweet from " & tweetUserName
			
			-- update this to be whatever you want the message body to be
			set theContent to "Hi Mom! Thought you might enjoy this: " & tweetText & ". Now don't say I never write! :-)"
			
			-- update theAddress to be whoever gets the message
			set theAddress to "mom@example.com"
			
			tell application "Mail"
				activate
				set newMessage to make new outgoing message with properties {account:theAccount, subject:theSubject, content:theContent}
				tell newMessage
					make new to recipient at end of to recipients with properties {address:theAddress}
					set visible to true
				end tell
				-- uncomment the following line if you want the message to be sent automatically
				--send newMessage
			end tell
		end if
	end if
	
end process_tweet
 
For anyone that's using the Twitterific/Applescript solution for capturing tweets into OF - I realized that I never posted the solution to my problem, quoted here.

What was happening for me is that the tweets must be marked as read, otherwise the script will be called for them every time Twitterific starts.

To mark them read, make sure the "Automatically show window when new tweets arrive" checkbox is "on". You'll probably also want to choose "After showing tweets, hide: *after 10 seconds*" option, I guess this is as close as we can get to getting Twitterific to process our tweets in the background, with no dupes. Turns out I never notice the window showing, because I'm always out and about when I create the tweets. :-)

Quote:
Originally Posted by fudster View Post
I'm noticing something here - I rarely restart my Mac so I didn't notice till now -

Every time I start Twitterific, it downloads about 40 or 50 recent tweets and they are processed again into new actions in my OF inbox.

Anyone else seen this? A quick browse through the preferences panels doesn't reveal a setting that might help with this. It seems like it's downloading old tweets again - and it's calling the hook script for every one.
 
Hi Fudster,
Thanks for posting this. Unfortunately, the solution above only worked about 50% of the time on my system. Alternatively we can hit CMD+K in Twitterrific to Mark all Tweets as Read. We can incorporate this into the applescript by putting these two lines after the END TELL pertaining to Omnifocus.

tell application "Twitterrific [GTD]" to activate
tell application "System Events" to keystroke "k" using command down


Note that I call my Twitterrific 3.2.4 by a different name to identify it in my system as the app I use solely for syncing with OF; If you copy and paste these lines, make sure to change the app name to what it's called on your system.

Also, CMD+K is mark ALL as read, however there is no concern for Tweets getting marked as read before getting into OF (ie, if I send five separate tasks to twitter, will all five make it to OF, or just the first?). Since this is invoked inside ON PROCESS_TWEET, the CMD+K is only affecting that currently processing tweet and all OLDER tweets; not the new tweets which are on queue to be processed right after.

Hope this helps
-Ricky


Quote:
Originally Posted by fudster View Post
For anyone that's using the Twitterific/Applescript solution for capturing tweets into OF - I realized that I never posted the solution to my problem, quoted here.

What was happening for me is that the tweets must be marked as read, otherwise the script will be called for them every time Twitterific starts.

To mark them read, make sure the "Automatically show window when new tweets arrive" checkbox is "on". You'll probably also want to choose "After showing tweets, hide: *after 10 seconds*" option, I guess this is as close as we can get to getting Twitterific to process our tweets in the background, with no dupes. Turns out I never notice the window showing, because I'm always out and about when I create the tweets. :-)
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
voice memos AEW OmniFocus 1 for Mac 4 2012-06-10 04:06 PM
No voice recording on iPad? pipeline OmniFocus for iPad 1 2010-06-12 06:35 PM
Voice Annotation TVGuy OmniFocus 1 for Mac 7 2009-02-26 01:02 AM
Voice Input kcdot OmniFocus for iPhone 0 2008-09-30 01:30 PM


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


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