Venom71 Posted July 17, 2008 Posted July 17, 2008 I got sick and tired of having to duplicate names and addresses in an FMP Application and in AddressBook. I figure if contact details need to be anywhere they should be in AddressBook and can therefore be used by a variety of applications. Here's two Applescripts that are the basics for integrating AddressBook with an FMP application: Script 1 - Adds and AddressBook entry into an FMP Table. It only requires 2 fields in the FMP DBMS. Field 1: The AddressBook ID for the contact entry. Field 2: The name of the contact person or company. Field 1 is for AddressBook lookups. Field 2 is for Value Lists, Portals etc. ------------------------------------------------- tell application "Address Book" set _groups to name of every group end tell choose from list _groups with title "Manage Your Meetings" with prompt "Select an Address Book Group" --display dialog result as string if the result is false then quit else getNames(item 1 of result) end if on getNames(theGroup) tell application "Address Book" set everyone to people in group theGroup set PeopleList to {} repeat with aPerson in everyone tell aPerson copy name to the end of PeopleList end tell end repeat end tell choose from list PeopleList with title "Manage Your Meetings" with prompt "Select a Person" if the result is false then quit else set thePersonsName to item 1 of result end if try tell application "Address Book" set thePerson to the first person whose name is thePersonsName tell thePerson set fmpName to name set fmpID to id end tell end tell on error display dialog thePersonsName & " is no longer in the Address Book" quit end try try tell application "FileMaker Pro Advanced" tell database "Address Book" set newRec to create new record tell newRec set cellValue of cell "AddressBook_UID" to fmpID set cellValue of cell "Name" to fmpName end tell end tell end tell on error display dialog "Could not add " & thispersonsname & " to the database" quit end try --open location "addressbook://" & thisisMyID end getNames ------------------------------------------------- Script 2 Selects an AddressBook entry based on the current record in FMP - this can expanded to do just about anything. tell application "FileMaker Pro Advanced" tell database "AddressBook" tell current record set ABID to cellValue of cell "AddressBook_UID" end tell end tell end tell try open location "addressbook://" & ABID on error display dialog "Could not find this person in your Address Book" end try ------------------------------------------------- Hope these help in some small way. Cheers V71
Søren Dyhr Posted July 17, 2008 Posted July 17, 2008 How did you become less fed up with that approach, it is still syncronization isn't it?? The approach to aim for is to have the values show in unstored calc' fields triggered by the rendering of the layout they're shown upon! --sd
Venom71 Posted July 17, 2008 Author Posted July 17, 2008 Thats an even better idea! Still learning with FMP and thanks for the criticism/suggestion.
Recommended Posts
This topic is 5971 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now