Newbie Question: Adding Items to a List

48 views
Skip to first unread message

Chris

unread,
Mar 10, 2013, 2:20:49 PM3/10/13
to yojimb...@googlegroups.com
Apologies for this, but I'm just learning the app. I have a To-Do list begun in Yojimbo. I'd like to add new items to the list without switching back to Yojimbo, e.g, when in Mail I'd like to copy a subject line and paste it into my To-Do list. How do I do that? Thanks! 

J. Stewart

unread,
Mar 11, 2013, 7:13:39 AM3/11/13
to yojimb...@googlegroups.com
On 3/10/13 at 2:20 PM, Chris <usabl...@gmail.com> spake thusly:
Assuming you have a tag collection using notes for your To-Do
list, this script will add one or more notes to that list. The
name of each item will be the subject of a selected email. As
written it also adds the contents of each email as the text of
the corresponding Yojimbo note.

The tag used in the script is "to-do". If your tag collections
uses a different tag just edit the line indicated below or your
existing tag.

Save this as a compiled script in the script menu (path =
/Users/*your neme here*/Library/Scripts/Applications/Mail/) and
it will be accessible in Mail.

--> Script <--
try
tell application "Mail"
set msgs to (get selection)
repeat with aMsg in msgs
set theName to subject of (contents of aMsg)
set theContent to content of (contents of aMsg)
my yjItem(theName, theContent)
end repeat
end tell
on error errMsg number errNum
display alert ("Error # " & errNum) message errMsg buttons
{"Cancel"} giving up after 10
end try

on yjItem(theName, theContent)
tell application "Yojimbo"
set itmID to (make new note item with properties
{name:theName, contents:theContent})
add tags {"to-do"} to itmID -- change list item to change tag.
end tell
end yjItem
--> /Script <--


JBS
--
Any sufficiently advanced technology is indistinguishable from
magic.  -Arthur C. Clarke

Chris

unread,
Mar 16, 2013, 11:29:57 PM3/16/13
to yojimb...@googlegroups.com
Thanks, John. I was hoping it might be a standard feature I wasn't seeing. I'd say your solution qualifies as magic ;)

John Stewart

unread,
Mar 18, 2013, 5:57:11 AM3/18/13
to yojimb...@googlegroups.com

On Mar 16, 2013, at 11:29 PM, Chris <usabl...@gmail.com> wrote:

> Thanks, John. I was hoping it might be a standard feature I wasn't seeing.
> I'd say your solution qualifies as magic ;)


BB is very, very good with Applescript support in all their products. That's the magic. :)
Reply all
Reply to author
Forward
0 new messages