How's this? tell application "Yojimbo" set mytags to {"QLogic", "Diary"} set mytitle to date string of (current date) -- find existing note set mynote to first note item whose name is mytitle if mynote is missing value then -- create a new note set mynote to (make new note item with properties ¬ {name:mytitle, contents:"imported on " & date}) add tags mytags to mynote end if activate open location "x-yojimbo-item://" & (get id of mynote) end tell
I don't know of a scriptable way to reveal items in the main window (I wish there was - it'd be useful) so the "open location" hack shows the item in a separate window. Hope this helps, Jim On Jan 18, 2008 11:04 AM, Michael Heinz <[EMAIL PROTECTED]> wrote: > Hey, > > I'd like to use Yojimbo to keep a daily work diary. To make it easier, > I'd like to set up an applescript that will create the title of the > diary entry (based on today's date) and either (a) find the entry if > it already exists or (b) create a new entry if it does not. > > I've figured out how to create the new entry, but I can't figure out > how to search Yojimbo to see if it already exists. In addition, I'm > not sure how to have Yojimbo select the diary entry and bring it to > the front. Here's what I have: > > tell application "Yojimbo" > set mytags to {"QLogic", "Diary"} > set mytitle to date string of (current date) > try > -- find existing note > set mynote to ??? > on error > -- create a new note > set mynote to (make new note item with properties ¬ > {name:mytitle, contents:"imported on " & date}) > > add tags mytags to mynote > end try > activate > -- how do I bring the note to the front? > end tell > > Thanks for any help you can give! > -- > Michael Heinz > Phoenixville, Pennsylvania > > > > -- > ------------------------------------------------------------------ > This message is sent to you because you are subscribed to > the mailing list <yojimbo-talk@barebones.com>. > To unsubscribe, send mail to: <[EMAIL PROTECTED]> > List archives: <http://www.listsearch.com/yojimbotalk.lasso> > Have a feature request, or not sure if the software's working > correctly? Please send mail to: <[EMAIL PROTECTED]> > -- ------------------------------------------------------------------ This message is sent to you because you are subscribed to the mailing list <yojimbo-talk@barebones.com>. To unsubscribe, send mail to: <[EMAIL PROTECTED]> List archives: <http://www.listsearch.com/yojimbotalk.lasso> Have a feature request, or not sure if the software's working correctly? Please send mail to: <[EMAIL PROTECTED]>