Did you try Address Book->Preferences->Template?
tell application "Address Book"
repeat with this_person in every person
repeat with this_homepage in every Homepage of this_person
remove this_homepage from Homepage of this_person
end repeat
end repeat
end tell
Try this:
Code:tell application "Address Book" repeat with this_person in every person repeat with this_homepage in every Homepage of this_person remove this_homepage from Homepage of this_person end repeat end repeat end tell
I'm not totally sure about the "Homepage" field (it could be homepage), but it's what I saw on the net. I'd backup Address Book before running.
This is what happens when you give advice from work and you don't have a Mac at work. 🙂
Thanks for that! I tried running the script with both 'Homepage' and 'homepage' but got error: expected class name but found identifier
--repeat this_homepage in every Homepage of this_person
--remove this_homepage from Homepage of this_person
--end repeat
Comment out (using --) the repeat/end repeat that used the Homepage part to make sure the error is with Homepage and I'll try to find the field name somewhere on the internet.
Code:--repeat this_homepage in every Homepage of this_person --remove this_homepage from Homepage of this_person --end repeat
That means the Homepage field is the problem. Still looking.
BTW, when you look at the Address Book, what is the part with the web page called? That might help.
![]()
looks like its 'homepage' hehe
Well that sucks. Try URL. Or try homepage again. Still haven't found anything definitive.
Edit: Also try url. I found some evidence of that being used for URL's in Applescript. I'll look at the Address Book plist tonight, if no one else comes to help.
url is a keyword in AppleScript, but doesn't relate to the URL associated with a contact. In AppleScript, under the File menu there's a dictionary item, which allows you to open the AppleScript dictionary for Address Book. From there I saw it's the 'home page' that you need to refer to. I've been trying it in the script, but it hasn't completely worked yet for the whole process, but I don't have many contacts with web pages, so that could be part of it.
I'm still on windows here. Did you change it to my post above.
Replacing url with home page.
tell application "Address Book"
repeat with this_person in every person
--repeat with this_homepage in every url of this_person
remove home page of this_person
--end repeat
end repeat
end tell
I was going by the poster above who said use home page. Change home page back to url and see what happens. Also, maybe url of home page?
tell application "Address Book"
set output to ""
repeat with this_person in every person
set numurl to count (urls of this_person)
if numurl > 0 then
set theurls to properties of urls of this_person
repeat with this_url in theurls
-- Capturing the urls and a new line
set output to output & (value of this_url as string) & return
-- Remove this url
--set value of this_url to ""
end repeat
end if
end repeat
display dialog output
end tell
Well, it appears Address Book uses home page, urls, and url depending on the context. Good grief. Anyways, here's a close solution. I was able to print each one out as a test. I commented out a line that should set it to an empty string, which should serve the same purpose as deleting it, but so far it doesn't work.
Where are you finding that info? I just looked at Address Book and it looked like the field was homepage with label URL to go in it.
I'll attach a screen shot of the dictionary. I've got a script that runs and says it's deleting things, but in Address Book, the urls are still there.
Off topic, but do you know where the data for Address Book is on OSX?
Looks to be ~/Library/Application Support/AddressBook/
The Metadata folder seems to hold individual vCard type data for each entry, but the AddressBook-v00.abcddb, which is a SQLite 3 database file may hold current info. Using a SQLite browser I can see the data in it. Using it all the URLs can be deleted. Definitely would want to make a backup before doing so just in case it breaks anything.
I'm using SQLite Database Browser 1.3 to browse the file. The table to look at is ZABCDURLADDRESS.
I wanted to know where it was so I could make a copy before messing with it.