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

 
AppleScript to force inbox clean up Thread Tools Search this Thread Display Modes
Looking for a way to tell OF to "Clean Up" the inbox without switching focus to the application.

Got a mail rule which assigns contexts, projects, due dates but will only place the task in the inbox requiring a final step to switch to OF and cmd+K.

Fussy yes I am but any ideas?

Tried the:

tell application omnifocus
compact front document
end tell

but it causes Of and mail to hang and then fail.

Thanks for any help,

C
 
Quote:
Originally Posted by cerithom View Post
Got a mail rule which assigns contexts, projects, due dates but will only place the task in the inbox
Tried the:

tell application omnifocus
compact front document
end tell

but it causes Of and mail to hang and then fail.
First, a silly question, just in case ...

Do you have the required double quotes around the application identifier, as in:

tell application "OmniFocus"
compact front document
end tell

or

tell application id "com.omnigroup.OmniFocus"
compact front document
end tell

If you do, what does the mail rule code look like ? You will need to slip a compact command in there somewhere ... (Probably just after the document makes a new task and sets its properties).

Last edited by RobTrew; 2010-03-03 at 02:26 AM..
 
Yes I do have the quotes in there.

Sorry it was a quick typed post rather than a copy paste from AppleScript.

tell application "System Events"
keystroke "C" using {command down, shift down, option down}
end tell

tell application "OmniFocus"
compact front document
end tell

Console message says: 03/03/2010 13:44:16 Mail[500] rejected messages (rule Digidelivery Posted), count 1

03/03/2010 13:46:17 OmniFocus[280] Presenting modal error: {
code = 2131;
domain = "com.omnigroup.OmniFocus";
userInfo = {
NSLocalizedDescription = "The script handler failed.";
NSLocalizedRecoverySuggestion = "Errors returned from handler <ScriptHandler:0x8b5cf20 com.omnigroup.OmniFocus.ScriptHandler.Mail_with_Ma ilTags NSBundle </Applications/Omnifocus 1.8/OmniFocus.app/Contents/PlugIns/BuiltInClippingHandlers.plugin> (not yet loaded)>: {\n NSAppleScriptErrorAppName = Mail;\n NSAppleScriptErrorBriefMessage = \"AppleEvent timed out.\";\n NSAppleScriptErrorMessage = \"Mail got an error: AppleEvent timed out.\";\n NSAppleScriptErrorNumber = -1712;\n NSAppleScriptErrorRange = NSRange: {2552, 9};\n}";
"com.omnigroup.framework.OmniBase.ErrorDomain.File LineAndNumber" = "/Volumes/Local/Users/Shared/omnibuild/ReleaseProduct/Source/OmniGroup/Applications/OmniFocus/App/AppleScript/ScriptHandler.m:405";
};
}

If that means anything?>?
 
Not quite sure what the context of the keystroke is, or how you are launching the script, but something for Omni, I think.

I would try OmniFocus > Help > Send feedback
 
Keystroke is called from a Mail rule to "Send clipping to Omnifocus" and that's my key-combo for that Service.

That combined with MailTags is what enables the email to be sent to OF's inbox in the first place.

Thank you for your help but as it stands the thread with Omni had drawn a blank.

C
 
I'm pretty sure clippings are always sent to the default document (which may not be in front).

Does the script work using default document instead of front document?

The (trivial) example below ran w/out complaint on my machine, FWIW.

Code:
tell application "OmniFocus"
	tell default document
		compact
	end tell
end tell
 
Brian,

Thank you very much that did the job.

Much appreciated.

C
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Applescript to create Inbox Items from Adium RussBlaisdell OmniFocus Extras 1 2011-01-05 03:09 PM
Applescript access to tasks in inbox dmcg OmniFocus Extras 2 2009-01-09 08:44 AM
Clean up moves Action Groups out of inbox? Jay Levitt OmniFocus 1 for Mac 5 2008-07-15 11:44 AM
How to "Clean-Up" (Command-K) in applescript umop OmniFocus Extras 2 2008-02-02 06:23 PM
Applescript to add Entourage message(s) to your inbox spnyc OmniFocus 1 for Mac 6 2007-06-23 10:10 AM


All times are GMT -8. The time now is 09:01 PM.


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