YAHOO! address problem

S

stu

I can't seem to import my Yahoo! addresses to Entourage OSX
without a million """"""""" " " " quotation marks before and after every name
and email address.

any tips?
thanks
 
S

stu

thanks for the tip, Mickey---

Berkowitz has got that script locked up behind a $20 fee,
which is fair and all,
but i wonder if there is any way to do this cost-free...

ideas?
 
B

Barry N. Wainwright

thanks for the tip, Mickey---

Berkowitz has got that script locked up behind a $20 fee,
which is fair and all,
but i wonder if there is any way to do this cost-free...

ideas?

Try this - I think it should work, but haven't tested it (because I don't
have your problems!)
(If you have multiple quotes in each section, you may need to run the script
several times, the way it stands now).


tell application "Microsoft Entourage"
repeat with aContact in (get every contact)
if first name of aContact contains "\"" then -- got a contact with
quotes
set first name of aContact to my stripQuotes(first name of
aContact)
end if
if last name of aContact contains "\"" then -- got a contact with
quotes
set last name of aContact to my stripQuotes(last name of
aContact)
end if

repeat with anAddress in (get every email address of aContact)
if contents of anAddress contains "\"" then
set contents of anAddress to my stripQuotes(contents of
anAddress)
end if
end repeat
end repeat
end tell

on stripQuotes(theText)
set AppleScript's text item delimiters to {"\""}
set theText to (text items of theText)
set AppleScript's text item delimiters to {""}
set theText to theText as text
return theText
end stripQuotes

--
Barry Wainwright
Microsoft MVP (see http://mvp.support.microsoft.com for details)
Seen the Entourage FAQ pages? - Check them out:
<http://www.entourage.mvps.org/toc.html>

Please post responses to this newsgroup. If I ask you to contact me
off-list, remove '.INVALID' from email address before replying.
 
P

Paul Berkowitz

Try this - I think it should work, but haven't tested it (because I don't have
your problems!)
(If you have multiple quotes in each section, you may need to run the script
several times, the way it stands now).


tell application "Microsoft Entourage"
repeat with aContact in (get every contact)
if first name of aContact contains "\"" then -- got a contact with
quotes
set first name of aContact to my stripQuotes(first name of
aContact)
end if
if last name of aContact contains "\"" then -- got a contact with
quotes
set last name of aContact to my stripQuotes(last name of aContact)
end if

repeat with anAddress in (get every email address of aContact)
if contents of anAddress contains "\"" then
set contents of anAddress to my stripQuotes(contents of
anAddress)
end if
end repeat
end repeat
end tell

on stripQuotes(theText)
set AppleScript's text item delimiters to {"\""}
set theText to (text items of theText)
set AppleScript's text item delimiters to {""}
set theText to theText as text
return theText
end stripQuotes

That method will work fine, but the quotes actually surround every and all
fields (about 29) which can be exported by Yahoo. First Name and Last Name
are the most annoying, of course, because they surround both parts of the
name, separately, and email addresses are perverted and won't work. But just
in case you've also imported home and/or work addresses, every element of
those too (street address, city, state, zip, country) is surrounded by
quotes, as are URLs, and so on. You'd have to go through every applicable
field. And the fields are set by the user using File/Import/Contacts,
matching imported Yahoo headers to Entourage field names. It could be done.
I found it a lot faster to parse and modify the text file (CSV, I think).


--
Paul Berkowitz
MVP Entourage
Entourage FAQ Page: <http://www.entourage.mvps.org/toc.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 Entourage you are using - 2001 or X.
It's often impossible to answer your questions otherwise.
 
Top