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.

Featured Replies

I have an Applescript that moves data from FMP to Address Book. It works fine, except when data is missing in FMP. Here is the Applescript:

tell current record

	set theFirstName to cellValue of cell "name_first"

	set theLastName to cellValue of cell "name_last"

    set theTitle to cellValue of cell "title"

	set theOrg to cellValue of cell "company_name"

	set theAdd to cellValue of cell "shipping_address_1"

	set theAdd2 to cellValue of cell "shipping_address_2"

	set theCity to cellValue of cell "shipping_city"

	set theState to cellValue of cell "shipping_state"

	set theZip to cellValue of cell "shipping_zip"

end tell



tell application "Address Book"

	activate

	set thePerson to make new person with properties {first name:theFirstName, last name:theLastName, job title:theTitle, organization:theOrg}

	make new address at end of addresses of thePerson with properties {label:"Work", street:theAdd & return & theAdd2, city:theCity, state:theState, zip:theZip}

	save addressbook

end tell

Not everyone has a Title. For those who do, the data transfers fine. However, if Title is blank in FMP, something happens when it is pushed to Address Book - it seems like AB locks that field or sets it to NULL or something. When I am in "Edit" mode in AB, I tab through the fields, but I cannot tab into the Job Title field.

Is there a way to say something like, if theTitle is not missing values then theTitle, else leave it alone (and make it editable within AB).

I would really like to use such a condition on all the fields, just to make sure values are passed.

Thanks.

  • Author

To demonstrate the problem, I've included a file - AB_exp_MissVal.fp7

There are three records:

John Doe has a title, so everything moves to AddressBook properly.

Jane Smith has no title. Once in AddressBook, in the Edit mode, I am unable to tab into the Job Title field to enter data.

Jones has neither a first name nor a title. Again, in AddressBook, in the Edit mode, I am unable to tab into the First Name field and the Job field.

In a way, this behavior is fine because it forces the user to make edits in the FMP data set. Nonetheless, I'm curious if there is a way to trap for Missing Values while I set the properties. In other words, if the value exists, set that property, otherwise, skip that property altogether.

Can anyone offer any insights?

Thanks.

AB_expt_MissVal.fp7.zip

One thing you could do is check for a value before setting it into Address Book. Set FileMaker data into a variable, then check the variable.

if aTitle ≠ "" then

-- set into AB

end if

  • Author

Thanks, Fenton. Then, will I need to do something where I set the properties? For instance, if I do this (abbreviated):)


set theFirst to cellValue of cell "name_first"

set theLast to cellValue of cell "name_last"

if theTitle ≠ "" then

	set theTitle to cellValue of cell "title"

end if

...

(in Address Book)

set thePerson to make new person with properties {first name: theFirst, last name: theLast, job title: theTitle}



etc.

The code above will produce an error message that says the variable theTitle is undefined.

  • 10 months later...

Is it possible to get back data from address book to Filemaker File?

Thanks, Fenton. Then, will I need to do something where I set the properties? For instance, if I do this (abbreviated):)


set theFirst to cellValue of cell "name_first"

set theLast to cellValue of cell "name_last"

if theTitle ≠ "" then

	set theTitle to cellValue of cell "title"

end if

...

(in Address Book)

set thePerson to make new person with properties {first name: theFirst, last name: theLast, job title: theTitle}



etc.

The code above will produce an error message that says the variable theTitle is undefined.

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.