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 request - Jump to Project Thread Tools Search this Thread Display Modes
Has anyone written a applescript that will Jump to a specific applescript from either a Launchbar or QS action? What happens to me is that will be in the middle of something else and a thought will occur to me about a particular project. I'd like to pull up launchbar type is a word or two for the project and have a new omnifocus window show up with just this project in it.

Thanks in advance,

George
 
I have something almost like that working (though not involving AppleScript). I have created OF perspectives that are focused on my folders (which I treat like "areas of responsbility"). So one called "Focused husband," another "focused teacher," etc. They are set to open as new windows.
Because I have added my perspectives directory (~/Library/Application Support/OmniFocus/Perspectives) to my Quicksilver catalog, I can easily pull them up with a couple of keystrokes to review or add stuff.
 
Craig,

Thanks for the response, but that won't quite do it for me. I tried. I can write the front end interface to capture the text string of the project and I am a so-so applescripter. If someone could show me even a fragment that will take that string and look for a project that contains that string, it might be all I need to complete it.

Thanks again,

George
 
Quote:
Originally Posted by gcrump View Post
If someone could show me even a fragment that will take that string and look for a project that contains that string, it might be all I need to complete it.
Try something like this:

Code:
set MyProjectArray to complete ProjectString as project maximum matches 1
You can see this in action in the "Send to OmniFocus" sample script inside the application bundle (OmniFocus.app/Contents/Resources/SampleScripts/Send to OmniFocus.applescript).

Hope this helps!
 
@ gcrump: if you get this working I hope you share it. It would be one step closer to my fantasy of a Quicksilver plugin for OF.
 
@ Craig - Will do.

@ Ken - I'm stuck and have messed with it all morning. Here is what I have, simple no error handling yet. Not much more than what you gave me. I can't figure out how to pull anything from MyProjectArray. In the Result section of script editor it is setting the variable right. For example if I type in "Spotlight" I get:

{{xml:"Customers : Permabit : Permabit <span class=\"match\">Spotlight</span> Article", score:225, id:"hMhoYt5pZ2e", name:"Customers : Permabit : Permabit Spotlight Article"}}

My assumption is that if I can figure out how to address the array, I can access the ID property and use that to show the Project in a new window. My goal was to add to the script the commands:

set MyProjectID to id of MyProjectArray
set newW to make document window with properties {focus:{MyProjectID}, selected view mode identifier:"project", search term:""}

to the script below. But I get an error on the set MyProjectID statement. If I just use the MyprojectArray in the {focus} I get an error there too...

display dialog "Enter Project to Find" buttons {"Cancel", "Find"} default button 2 default answer "" with title "Project Find"
if button returned of result is "find" then
set ProjectString to text returned of result
tell application "OmniFocus"
set MyDoc to default document
tell MyDoc
set MyProjectArray to complete ProjectString as project maximum matches 1
end tell
end tell
end if


Any help would be appreciated... Thanks.

Last edited by gcrump; 2008-05-21 at 07:27 AM..
 
You're almost there! You just need to pull out the id of the first item in the array, then use that id to look up the project. Like this:

Code:
display dialog "Enter Project to Find" buttons {"Cancel", "Find"} default button 2 default answer "" with title "Project Find"
if button returned of result is "find" then
	set ProjectString to text returned of result
	tell application "OmniFocus"
		set MyDoc to default document
		tell MyDoc
			set MyProjectArray to complete ProjectString as project maximum matches 1
			set MyProjectID to id of first item of MyProjectArray
			set ThisProject to project id MyProjectID
			set newW to make document window with properties {focus:{ThisProject}, selected view mode identifier:"project", search term:""}
		end tell
	end tell
end if
 
Ken,

Thanks for all the help, well and doing most of the work. What I am struggling with now is to make sure I have the filters set correctly. I figured out how to set the sidebar but I want to show all remaining tasks as well. I think I should use either the set (selected task state filter identifier) to "remaining" statement of the available task state filter but both result in an error...

Code:
display dialog "Enter Project to Find" buttons {"Cancel", "Find"} default button 2 default answer "" with title "Project Find"
if button returned of result is "find" then
	set ProjectString to text returned of result
	tell application "OmniFocus"
		set MyDoc to default document
		tell MyDoc
			set MyProjectArray to complete ProjectString as project maximum matches 1
			set MyProjectID to id of first item of MyProjectArray
			set ThisProject to project id MyProjectID
			set newW to make document window with properties {focus:{ThisProject}, selected view mode identifier:"project", search term:""}
			set (selected smart group identifier of sidebar of newW) to "remaining-projects"
			-- set (selected task state filter identifier) to "remaining"
		end tell
	end tell
end if
Thanks again for all your help!
 
Quote:
Originally Posted by gcrump View Post
I figured out how to set the sidebar but I want to show all remaining tasks as well. I think I should use either the set (selected task state filter identifier) to "remaining" statement of the available task state filter but both result in an error...
Try this:

Code:
set selected task state filter identifier of content of newW to "incomplete"
Glad I could help!
 
Very cool! :cool:
I just added an "activate" before the last "end tell"
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Keyboard shortcut to jump to a particular project? ecf OmniFocus 1 for Mac 6 2011-07-06 03:09 PM
Jump to Project sprocketjockey OmniFocus 1 for Mac 5 2011-05-10 07:55 AM
Feature Request : Jump quickly from action to project alexjrice OmniFocus for iPhone 12 2011-01-02 02:11 AM
A way to jump from a task to its home project? jkorentayer OmniFocus 1 for Mac 4 2009-10-19 01:09 PM
jump to project from action? hexsprite OmniFocus for iPhone 4 2008-08-15 05:54 PM


All times are GMT -8. The time now is 03:26 AM.


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