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 |
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] |
whpalmer4: Perfection! Thanks very much.
|
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.