• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Changes to Address Book?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to Address Book?


  • Subject: Changes to Address Book?
  • From: sacredquest <email@hidden>
  • Date: Thu, 15 Sep 2011 07:41:59 +1000

I had written an apple script that collects info from Filemaker and puts those contact details into Address Book.

It was working well, but something changed a couple of months ago (I'm not sure when it stopped working, so I can't tell you what changed sorry). It looks like address book has changed the way that it collects data.

I also have an iCal applescript, and that continues to work.

I have tried my script in applescript editor, and the script picks up the info from FM,, so the issue is not on the info collecting side.

I have the 2 scripts as below - my original and the modified.

Cheers

Andrew McLean


THIS IS THE ORIGINAL SCRIPT H=THAT WORKED

-- grab the data from Filemaker
tell application "FileMaker Pro Advanced"
	tell current record
		set theFirstName to cellValue of cell "Customer FirstName"
		set theLastName to cellValue of cell "Customer LastName"
		set thePhoneMobile to cellValue of cell "Phone_Mob"
		set thePhonehome to cellValue of cell "Phone Home"
		set thePhonework to cellValue of cell "Phone work"
		set theEmail to cellValue of cell "email"
		set theNotes to cellValue of cell "Vehicle List"
	end tell
end tell
tell application "Address Book"
	set foo to make new person at the end of the people with properties {first name:TheFirstName, last name:theLastName, company:false, organization:""}
	make new email at end of foo's emails with properties {label:"home", value:theEmail}

	make new phone at end of foo's phones with properties {label:"mobile", value:thePhoneMobile}
	make new phone at end of foo's phones with properties {label:"work", value:thePhonework}
	make new phone at end of foo's phones with properties {label:"home", value:thePhonehome}
     set note of foo to theNotes
     add foo to group "Triple C Customers"
	save addressbook
end tell


THIS IS THE SCRIPT AS MODIFIED SO FAR - IT CREATES A NEW PERSON, BUT DOES NOT POPULATE IT WITH INFO

-- grab the data from Filemaker
tell application "FileMaker Pro Advanced"
	tell current record
		set theFirstName to cellValue of cell "Customer FirstName"
		set theLastName to cellValue of cell "Customer LastName"
		set thePhoneMobile to cellValue of cell "Phone_Mob"
		set thePhonehome to cellValue of cell "Phone Home"
		set thePhonework to cellValue of cell "Phone work"
		set theEmail to cellValue of cell "email"
		set theAddressLine1 to cellValue of cell "Address Line 1"
		set theAddressSuburb to cellValue of cell "Address Suburb"
		set theAddressState to cellValue of cell "Address State"
		set theAddressZip to cellValue of cell "Address Pcode"
		set theNotes to cellValue of cell "Vehicle List"
	end tell
end tell

tell application "Address Book"
activate

	set thePerson to make new person with properties {first name:TheFirstName, last name:theLastName, company:false, organization:""}

	save addressbook
end tell


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Changes to Address Book?
      • From: Marc <email@hidden>
  • Prev by Date: Re: entire contents
  • Next by Date: Re: Display Model Name
  • Previous by thread: Re: Display Model Name
  • Next by thread: Re: Changes to Address Book?
  • Index(es):
    • Date
    • Thread