The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   Jumping to a folder (http://forums.omnigroup.com/showthread.php?t=10505)

gcrump 2008-11-08 10:02 AM

Jumping to a folder
 
I could use some help modify a script that I had a lot of help with. The script below finds a project that starts with a name that I enter into the dialog. I would like to do something similar but at the folder level. What I would like to do is type in the name of the folder, then have it open a new window with just that folder and all the available and remaining projects showing.

Can anyone help?

Here is the original script:

tell application "OmniFocus"
set MyDoc to default document
tell MyDoc
display dialog "Enter Project to Jump to" buttons {"Cancel", "Jump"} default button 2 default answer "" with title "Jump"
if button returned of result is "Jump" then
set ProjectString to text returned of result
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 of content of newW to "incomplete"
-- set selected task state filter identifier of content of newW to "all"
activate
end if
end tell
end tell

whpalmer4 2008-11-08 11:56 AM

Try this on for size:

[code]
tell application "OmniFocus"
set MyDoc to default document
tell MyDoc
display dialog "Enter Folder to Jump to" buttons {"Cancel", "Jump"} default button 2 default answer "" with title "Jump"
if button returned of result is "Jump" then
set ProjectString to text returned of result
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 ThisFolder to container of ThisProject
set newW to make document window with properties {focus:{ThisFolder}, 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 of content of newW to "incomplete"
-- set selected task state filter identifier of content of newW to "all"
activate
end if
end tell
end tell
[/code]

gcrump 2008-11-08 12:20 PM

whpalmer4: Perfection! Thanks very much.

iNik 2008-11-10 11:41 AM

I already gave this to George, but [url=http://dl.getdropbox.com/u/172082/Super%20Folder%20Jump.scpt]here's a beefed-up script[/url] that works with LaunchBar as well as when invoked directly.


All times are GMT -8. The time now is 11:37 PM.

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