> Hi Chris,
>
> I’m way behind on the list, life does sometimes intervene, but I wrote a
> script (well, modified a script Paul wrote for something else) that does what
> you want. It will throw up a dialog asking you to name the note, if you type
> something in the dialog it will use it for the name, however if you simply hit
> <return> , or, delete the default text in the dialog, it will use the Subject
> of the note you extracted the text from for a name. I include this knowing
> that I’ll later see a version from Allen and four from Paul that already
> address your issues, but what the hey, here it is:
Thanks so much Jim. Allen did hammer a coherent script together out of
the mess I’d made, but this one you’ve put together works great! Thanks
so much for responding. Have you submitted it to AS Central?
CMS
(script follows in HTML)
-- Script from a message sent by Paul Berkowitz----------------------end script-----------
-- on Thursday, October 12, 2000 8:42:53 PM
(* Modified ever so slightly by Jim Baskins on October 18, 2000 from Paul's Make Event Selected Text Script. *)
-------------------------------Make Note Selected Text--------------------
global selectedMessages
tell application "Microsoft Entourage"
activate
-- get the currently selected text
set selectedMessages to current messages
set theSelection to the selection
if class of theSelection = string then
set selectedText to theSelection -- could be "" if focus is in message text
set frontMsg to displayed message of window 1
my MakeNote(frontMsg, selectedText)
else
set selectedText to "" -- to define it
repeat with theMessage in selectedMessages
my MakeNote(theMessage, selectedText)
end repeat
end if
-- if there is no text selected, select the current message or messages
end tell
to MakeNote(theMessage, selectedText)
tell application "Microsoft Entourage"
-- get the information from the message, and store it in variables
set theName to text returned of (display dialog "Enter a Name for this Note" default answer "Type New Note Name Here")
if theName = "" then
else if theName = "Type New Note Name Here" then
set theName to subject of theMessage
end if
set theCategory to category of theMessage
if selectedText = "" then
set theContent to content of theMessage
else
set theContent to selectedText
end if
-- create a new note with the information from the message
set newNote to make new note with properties {name:theName, category:theCategory, content:theContent}
-- create a link between the message and the new note
link theMessage to newNote
-- if there was only one message selected, then open that new note
if (count of selectedMessages) = 1 then open newNote
end tell
end MakeNote
