Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Address Book Scripts

Featured Replies

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

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

  • Author

Thats an even better idea! Still learning with FMP and thanks for the criticism/suggestion.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.