The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus 1 for Mac (http://forums.omnigroup.com/forumdisplay.php?f=38)
-   -   Searching for projects by strings in their notes (http://forums.omnigroup.com/showthread.php?t=23907)

RobTrew 2012-04-06 09:29 AM

Searching for projects by strings in their notes
 
I've been asked whether one can find projects by keys (string patterns) stored in their notes.

My first response is to suggest a [URL="http://bit.ly/OF-Find2"]Where in OF[/URL] search like:[INDENT][I]projects where note contains[/I] "StringPattern"[/INDENT]
but others may have better suggestions ...

[COLOR="White"]--[/COLOR]

RicardoSaporta 2012-04-06 01:09 PM

Rob,

Thank you very much for posting this. If I could bug you with another question of how to properly invoke Where in OF in an applescript?

ideally, I would like to create a new task in a project that contains a specified Key in its notes.

something like:

[code]
set myNewTask to (make new task with properties {name:...} at end of tasks of (project where note contains "StringPattern"))
[/Code]

is that possible?

Thanks for the help
Ricky

RobTrew 2012-04-06 01:46 PM

That can be done directly in Applescript - no need for Where in OF.

Something like:

[CODE]tell application id "OFOC"
tell front document
set lstMatch to flattened projects where note contains "StringPattern"
if length of lstMatch < 1 then
display dialog "No matches"
return
end if

tell first item of lstMatch
make new task with properties {name:"Some task name"}
end tell
end tell
end tell[/CODE]

RicardoSaporta 2012-04-09 08:05 AM

Rob, thanks as always for your help! Incidentally, the Where in OF works great for finding the Key on the fly.


All times are GMT -8. The time now is 06:02 PM.

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