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

 
Clip-o-Tron from Mail rule? Thread Tools Search this Thread Display Modes
Context:
Overwhelmed AppleMail Inbox
MailTags 2.2.3
Mail Act-On 2.0.5

I've done a cursory search of the extensive forum discussion regarding moving mail from Apple Mail to OF and cannot find an answer to what I hope is probably a simple question: Is there a way to invoke the Clip-o-Tron from within a Mail rule? Alternatively, is there a script out there that replicates the Clip-o-Tron functionality more completely than OF's mail action script?

Specifically, I need to be able to automatically process certain emails (file, change the status of parent emails, add MailTag projects etc. and send them to OF 1) with their attachments (if present) and 2) auto-assigning the project. Clip-O-Tron accomplishes these latter two goals, but the OF mail action rule (and Curt Clifton's older mail-to-OF scripts, dug out of his archive) do not. I'm a scripting simpleton, so doing this myself is pretty much out of the question. (Might be fun to learn, but that pretty much defeats the whole GTD reason for working this hard to streamline the workflow.)

Any idea?
 
I have the same questions.... thanks
 
When you activate the clip-o-tron, it sets up a mail rule for its activation.
You can add other Mail actions to be performed when it is activated.
 
Quote:
Originally Posted by Lucas View Post
When you activate the clip-o-tron, it sets up a mail rule for its activation.
You can add other Mail actions to be performed when it is activated.
Where can I find the rule? It's not in the Mail Rule listings. I've tried removing the Clip-o-Tron, restarting Mail, restarting OF, then enabling the Clip-o-Tron and repeating the process. Can't find it.
 
Quote:
Originally Posted by grichar1 View Post
Is there a way to invoke the Clip-o-Tron from within a Mail rule?
The only way I can think of would be to use UI scripting to click on the Clip-O-Tron's menu item:

Code:
activate application "Mail"
tell application "System Events"
	tell process "Mail"
		click menu item "OmniFocus: Send to Inbox" of menu 1 of menu item "Services" of menu 1 of menu bar item "Mail" of menu bar 1
	end tell
end tell
I'm not sure if that works from a Mail rule or not; presumably you'd want to make sure the message was selected in the frontmost viewer before you invoke the clipping service.

Quote:
Alternatively, is there a script out there that replicates the Clip-o-Tron functionality more completely than OF's mail action script?

Specifically, I need to be able to automatically process certain emails (file, change the status of parent emails, add MailTag projects etc. and send them to OF 1) with their attachments (if present) and 2) auto-assigning the project.
Unfortunately, AppleScript doesn't really support rich text with embedded attachments (such as inline images): that's why we wrote the Clip-O-Tron using pasteboard services (augmented with AppleScript) rather than simply using AppleScript by itself.

(I'm not quite sure what you mean by "auto-assigning the project"; it's definitely possible to look up projects and assign them to tasks you create from AppleScript, and I think there are some examples posted which do this.)
 
Quote:
Originally Posted by Ken Case View Post
The only way I can think of would be to use UI scripting to click on the Clip-O-Tron's menu item:
Thanks for looking at this, Ken. I never would've thought to use the UI. The script you wrote works great from the script editor, and it's actually pretty quick (UI scripts I've used in other contexts run pretty slow). But your intuition is correct; it doesn't work from within a Mail rule. The UI references get lost somehow, even when I expressly tell System Events to put mail frontmost. There's nothing useful in the Console-- the commands just disappear.



Quote:
Originally Posted by Ken Case View Post
(I'm not quite sure what you mean by "auto-assigning the project"; it's definitely possible to look up projects and assign them to tasks you create from AppleScript, and I think there are some examples posted which do this.)
For reference, I was referring to the ability Clip-O-Tron has to use a MailTags Project name, if present and equal to an OF project name, as the project of the new task. I can't find this functionality in any of the scripts, current or past, for moving mail to OF. I had another look at the scripts included in this Forum and couldn't find anything. If you know of one I could use as a template, please let me know.

Thanks again for looking.
 
Quote:
Originally Posted by grichar1 View Post
For reference, I was referring to the ability Clip-O-Tron has to use a MailTags Project name, if present and equal to an OF project name, as the project of the new task. I can't find this functionality in any of the scripts, current or past, for moving mail to OF. I had another look at the scripts included in this Forum and couldn't find anything. If you know of one I could use as a template, please let me know.
Inside the OmniFocus app itself you'll find the AppleScript code used to handle clipping from MailTags, in OmniFocus.app/Contents/PlugIns/BuiltInClippingHandlers.plugin/Contents/Resources/Mail-with-MailTags.applescript.

Here are the relevant excerpts:

Code:
using terms from application "MailTagsScriptingSupport"
	set MyProjectName to project
end using terms from

tell MyTask
	set MyProject to missing value
	try
		if MyProjectName is not missing value then -- will raise if the value is undefined/null
			tell containing document
				set MyPossibleProjects to complete MyProjectName as project maximum matches 1
				if (count of MyPossibleProjects) is not 0 then
					set MyProjectID to (id of item 1 of MyPossibleProjects)
					set MyProject to project id MyProjectID
				end if
			end tell
		end if
	end try
end tell
There are a number of other scripts bundled inside OmniFocus.app which might be useful reference material:

Code:
% find OmniFocus.app -name '*.applescript'
OmniFocus.app/Contents/PlugIns/BuiltInClippingHandlers.plugin/Contents/Resources/Default.applescript
OmniFocus.app/Contents/PlugIns/BuiltInClippingHandlers.plugin/Contents/Resources/Finder.applescript
OmniFocus.app/Contents/PlugIns/BuiltInClippingHandlers.plugin/Contents/Resources/Mail-Leopard.applescript
OmniFocus.app/Contents/PlugIns/BuiltInClippingHandlers.plugin/Contents/Resources/Mail-with-MailTags.applescript
OmniFocus.app/Contents/PlugIns/BuiltInClippingHandlers.plugin/Contents/Resources/NetNewsWire.applescript
OmniFocus.app/Contents/PlugIns/BuiltInClippingHandlers.plugin/Contents/Resources/OmniPlan.applescript
OmniFocus.app/Contents/PlugIns/BuiltInClippingHandlers.plugin/Contents/Resources/OmniWeb.applescript
OmniFocus.app/Contents/PlugIns/BuiltInClippingHandlers.plugin/Contents/Resources/Safari.applescript
OmniFocus.app/Contents/Resources/MailAction.applescript
OmniFocus.app/Contents/Resources/SampleScripts/DumpContextTasks.applescript
OmniFocus.app/Contents/Resources/SampleScripts/Publish to iCal.applescript
OmniFocus.app/Contents/Resources/SampleScripts/Send to OmniFocus.applescript
OmniFocus.app/Contents/Resources/UpdateMailActionInstallation.applescript
Hope this helps!
 
Interesting thread. I'm trying to do something similar, in that my goal is to have any email I send that is marked with a tickler date, automatically get added to OmniFocus. Between Mail Tags / Mail Act On / Omnifocus, all the parts seem to exist, it's just a matter of getting them to play together.
 
Was anyone ever able to cobble together a working solution for this?
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slow Clip-o-Tron with Mail.app on Lion alex.vollmer OmniFocus 1 for Mac 4 2013-01-14 08:53 PM
Mail Clip-O-Tron 3000 kanders001 OmniFocus 1 for Mac 1 2009-11-12 01:42 PM
Help - Clip-o-tron and Mail 4.1: not working for me. Tinchohs OmniFocus Extras 3 2009-09-24 01:05 PM
Mail Rule vs Clip-O-Tron shovland42 OmniFocus 1 for Mac 1 2008-10-17 09:08 AM
Mail Clip-O-Tron 3000 has me baffled? jwhitetoo OmniFocus 1 for Mac 5 2008-01-14 09:35 AM


All times are GMT -8. The time now is 12:05 AM.


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