AnsweredAssumed Answered

Help with If/then or case script step. Send Mail script.

Question asked by EricClute on Feb 20, 2015
Latest reply on Feb 20, 2015 by philmodjunk

Title

Help with If/then or case script step. Send Mail script.

Post

Hello!

 

I'm very new to Filemaker and script writing, so please play nicely.  I'm writing a script that will compose an email automatically for the user. However I cannot figure out the calculation I need to grab the correct email addresses.  

I have a field called "paper authors::pacontactauthor" that, when a "1" is in the field (it's a checkbox), it indicates that this specific author should receive the email.  I need the script to enter another layout and grab any email addresses associated with the contact author. We have 2 separate fields for email addresses, and I want both (if there are any).  

What I have tried hasn't worked.  I either end up with no emails, every email for every author (not just the contact author), or with a "blank" email intermixed with the emails I want.  

 

If ( PaperAuthors::PAContactAuthor = "1" ; GetField ( If ( Authors::Email1 ≠ "" ; Authors::Email1 ; Authors::Email2 ) ) )

 

The above is my best guess, but alas, it doesn't work. Should I be using the Case function?

I'm running FM 13.0v5 Pro Advanced in OSX 10.9.5.  

Thanks!

Outcomes