On Jan 18, 2008, at 12:38 PM, Jim DeVona wrote:

        -- 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


In my testing here, this causes an error (in Script Debugger) when no such item exists. I had to change the test for finding an existing note as follows:

        -- find existing note
        set resultList to get (every note item whose name is mytitle)

        if (count of resultList) is 0 then
                -- create a new note
                set mynote to (make new note item with properties ¬
{name:mytitle, contents:"imported on " & mytitle}) -- N.B. changed 'date' to 'mytitle'
                add tags mytags to mynote
        else
                set mynote to first item of resultList
        end if



Alan


--
------------------------------------------------------------------
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]>

Reply via email to