April 27, 201312 yr I am a newbie to FileMaker and use Pro 12 Adv with Windows Vista and Outlook 2007. I am creating my first DB and have an email function in it. I have tried with no success to create a script that will only send email if the email address field is populated. It seems that the script is not being looked at and the email will not work at all unless the "Button Setup" has been created. I have tried all the suggestions in the forums and other sites with no success. What am I forgetting? Thanks for all your help. Dave
April 28, 201312 yr Dave, Post the script and you will receive more help - It seems that the script is not being looked at and the email will not work at all unless the "Button Setup" has been created. Not sure what you mean by this Jim
April 28, 201312 yr Author Dave, Post the script and you will receive more help - Not sure what you mean by this Jim Here it is Jim. Thanks in advance for looking into this. If [isEmpty ( Studios::Studio_eMail )] Omit Record Else Send Mail [send via E-mail Client; To: Studios::Studio_eMail] End If Dave
April 29, 201312 yr You nearly had it - From FMP Help: IsEmpty Purpose Returns True(1) if field is empty, if a related field, related table, relationship, or file is missing, or if some other error occurs; otherwise, returns False(0). So your script should look like this: If [isEmpty ( Studios::Studio_eMail )] = 1 Omit RecordElse Send Mail [send via E-mail Client; To: Studios::Studio_eMail]End If Is there more to your script? This would only work for the current record. If you want to automate this script over multiple records add a loop. Hope this helps! Jim
April 29, 201312 yr Author You nearly had it - From FMP Help: IsEmpty Purpose Returns True(1) if field is empty, if a related field, related table, relationship, or file is missing, or if some other error occurs; otherwise, returns False(0). So your script should look like this: If [isEmpty ( Studios::Studio_eMail )] = 1 Omit Record Else Send Mail [send via E-mail Client; To: Studios::Studio_eMail] End If Is there more to your script? This would only work for the current record. If you want to automate this script over multiple records add a loop. Hope this helps! Jim Yes. I am only doing this for the active record (at this time). Wow. Thanks. I had used the "=1", but in all the wrong places! BUT - I can't figure out how to get the "= 1" AFTER the trailing "]". I can't access in-line statement editing. Dave
April 29, 201312 yr If [isEmpty ( file::field )] or Not IsEmpty( field ) maybe technically there some theory, i am not that bright but.... I been using for years...thousands of time, my standard practice, this format.. Have never need tested if 1 or 0
April 29, 201312 yr Author If [isEmpty ( file::field )] or Not IsEmpty( field ) maybe technically there some theory, i am not that bright but.... I been using for years...thousands of time, my standard practice, this format.. Have never need tested if 1 or 0 Thank you Rod. I'll give this a shot and respond with my results. Dave
April 29, 201312 yr Author Thank you Rod. I'll give this a shot and respond with my results. Dave Thank you Rod. I'll give this a shot and respond with my results. Dave I tried the IsEmpty route with no results. I am launching the script from clicking an embedded picture. The trigger I am using is OnObjectEnter. Would this be correct? Dave
April 29, 201312 yr I've attached a screenshot om my calc dialog box and in this format your script works for me (obviously you need to substitute Table::field).  And you OnObjectEnter trigger should work fine  Jim
April 29, 201312 yr Author I've attached a screenshot om my calc dialog box and in this format your script works for me (obviously you need to substitute Table::field). And you OnObjectEnter trigger should work fine Jim ...hmmmm... I am using the same script, but the script trigger is being ignored (or appears to be). Nothing I do in the script is actually being performed. Am I missing something at a more basic level? Dave
April 29, 201312 yr Seems your script trigger is not firing - in layout mode be sure the field with the photo/trigger is brought to the front. You could also set the field up as a Button to perform the script.
April 29, 201312 yr Author This is my script that doesn't get triggered (I suppose). Either with or without the "= 1" doesn't work. The field for the actual email address is formatted as TEXT with no special options set. The button I press to trigger the script is an image. <sigh> such a learning curve. Using the actual field as a trigger works the same as the script (or Button setup). Â Dave Â
April 29, 201312 yr Author The "=1" is completely unnecessary unless you are using GetAsBoolean.  New script. Still does not work however. I've been looking (somewhat feverishly) for a fix. This script only has to work on the current record.  Here's the current non-working script.  Thanks. Dave
April 30, 201312 yr Since you have Advanced, have you tried stepping through the script with Script Debugger and looking at error messages, and whether another script is being set by a script trigger?
April 30, 201312 yr Author Solution Since you have Advanced, have you tried stepping through the script with Script Debugger and looking at error messages, and whether another script is being set by a script trigger?  Thank you Doug.  Yes I did. I've been running it all day long - until just now I had no positive results.  I just ran the debugger with a "fresh pair of eyes" (I went and cut the grass and ate dinner) and lo and behold - the button was running the wrong script! I had written the one I showed in my previous email, but didn't connect it to the email button <sigh>.  Okay then. So I sleep well tonight.  Thanks for the encouragement Doug, Rick, Jim and Rod.  For those who missed the answer I attached it again here for you.  Dave
Create an account or sign in to comment