Note that I sent the scripts in HTML so as to preserve the long lines.
Copy
and paste that HTML version to Script Editor, or they won't compile
without
tedious removal of hard-wrapped lines.
--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <
http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <
http://macscripter.net/scriptbuilders/>
Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.
PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
From: Julia <
[email protected]>
Organization: AT&T ASP.att.net
Newsgroups: microsoft.public.mac.office.entourage
Date: Fri, 04 Aug 2006 02:56:50 GMT
Subject: Re: How to change default of "Add to Address Book" command
Wow! Thanks so much for that, Paul. Two keystrokes instead of all that
mousing sounds pretty sweet to me. I will try it out this weekend.
You could do it by AppleScript but it would be not much quicker except
that
instead of clicking the "Move to..." button and selecting the
appropriate
Address Book, you'd be selecting a menu item in the Script menu. One
fewer
click. A keyboard shortcut could be used instead, if you wish. I suppose
you
could also use a different script, with its own keyboard shortcut,
instead
of "Edit this Contact", too.
OK, so here's a script that opens the contact of the sender of a
selected
message. If the contact already exists, it does the same as "Edit this
Contact". If the contact doesn't exist, it makes one and opens it, like
"Add
to Address Book". If you save it in Script Editor
(/Applications/AppleScript) as a Script named "Edit This Contact \mc=",
you
can run it by pressing cmd-ctrl-= (Apple key + control key + Equals sign
key). See "About the script menu" in Help if you want a different
keyboard
shortcut.
--------------------- Edit This Contact \mc= --------------------------
tell application "Microsoft Entourage"
try
set theSender to sender of item 1 of (get current messages)
on error
beep
return
end try
set {dName, eAddress} to {display name, address} of theSender
try
set theContact to item 1 of (find eAddress)
on error
set AppleScript's text item delimiters to {" "}
set allNames to text items of dName
if allNames , {""} then
if (count allNames) > 1 then
set lName to last item of allNames
set fName to items 1 thru -2 of allNames as Unicode text
else
set lName to ""
set fName to last item of allNames
end if
else
set {lName, fName} to {"", ""}
end if
set AppleScript's text item delimiters to {""}
set theContact to make new contact with properties {first
name:fName, last name:lName, email address:eAddress}
end try
open theContact
end tell
---------------------------------------
OK. Now here's the script that saves, closes and moves the contact to
your
Exchange account's Contacts address book. (If you don't want to close
the
contact window. remove the penultimate line ('close...') above the 'end
tell' line.) If you happen to have more than one Exchange account then
instead of 'first Exchange account' in the last line, use 'Exchange
account
"Account Name"'.
If you save this script as "Move Contact to Exchange \mcM" then you can
run
it by pressing cmd-ctrl-M (Apple key + control key + M). Again see
"About
the script menu" in Help if you want a different keyboard shortcut.
--------------------- Move Contact to Exchange \mcM
--------------------------
tell application "Microsoft Entourage"
set frontWindow to front window
if class of frontWindow , contact window then
beep
return
end if
set theContact to displayed feature of frontWindow
close frontWindow saving yes
move theContact to primary address book of first Exchange account
end tell
---------------------------------------
--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <
http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <
http://macscripter.net/scriptbuilders/>
Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.
PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
From: Julia <
[email protected]>
Organization: AT&T ASP.att.net
Newsgroups: microsoft.public.mac.office.entourage
Date: Thu, 03 Aug 2006 03:48:49 GMT
Subject: Re: How to change default of "Add to Address Book" command
As I posted elsewhere in the thread (and apologies for repeating it
here), I figured out a workaround when I realized that the "Add to
Address Book" command placed the contact in the address book of
whichever account (Exchange or local) had received the message:
Here's the clunky workaround I've developed: When I click on the blue
dot next to the sender's name in the e-mail, I choose "Edit This
Contact" instead of "Add to Address Book." This opens the contact
window. I click Save, then under the Contact menu, choose "Move to ..."
and select my Exchange Contacts list in the resultant dialog box. It's
a
bit time-consuming, and I'd love to hear any suggestions for making it
easier. I wonder if it would be possible to automate this using
AppleScript? I know nothing about writing scripts, unfortunately.
As this says, I'd love to know if there would be a way to use
AppleScript to make this an easier process. I welcome any advice you
might have.
Julia
The way to do it is to change the Default Mail Account, in
Tools/Accounts/Mail, to your Exchange account (select it and click
"Make
Default"). Then contacts should be added to your Exchange address
book. I
think you must have a POP or IMAP account select as your default mail
account?
Which means that when you click New for a new email message it comes
from
this POP or IMAP account. If that's in fact what you want, there's no
way
around this aside from either constantly switching the default mail
account
back and forth, or else opening one of the address books into its own
window
- via File/Open New Main Window, or else double-clicking one of the
address
books after setting Preferences/General/Double-clicking folders
opens...)
and then dragging the contact from one address to the other and
optionally
deleting it from the first one.
--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <
http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <
http://macscripter.net/scriptbuilders/>
Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.
PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
From: <
[email protected]>
Organization:
http://groups.google.com
Newsgroups: microsoft.public.mac.office.entourage
Date: 31 Jul 2006 01:27:36 -0700
Subject: Re: How to change default of "Add to Address Book" command
Julia, did you find a solution to this? I have the same problem. I
have
two address books, one is the one that syncs with my exchange server
(contacts [name of the server]) and the other one only on the laptop
(address book [on my computer]) and obviously i would like that all
addresses I add on the laptop make it to the server.
p
Julia wrote:
I searched the archives of the group on Google, but could not find
an
answer to this specific question. I am using Entourage 2004, and I
have
both POP and Exchange accounts. The Exchange account is the default
account, and as such when I click the Address Book icon, that is the
address list that is shown.
However, if I have a particular message selected, and I use the "Add
to
Address Book" command either under the Tools menu or by clicking the
little ball next to the sender's name when the message is displayed
in
the Preview pane, the contact is added to the Address Book (On My
Computer), even though I don't use that one and it is otherwise
empty.
Is there any way either to change the default on this particular
command, or be given the opportunity to select which address book is
used when I invoke this command?
Thanks so much for any help you can offer.
Julia