July 29, 20205 yr In a script, I execute a loop to compute a text string consisting of a comma-separated list of email addresses, which will be used outside of FM to send an email. The string is stored in a local variable, $EmailAddressString. When the string is fully computed, I set a global field to $EmailAddressString, and then I execute the script step Copy with target set to that global field. However, the string doesn't get copied to the clipboard. Instead, the Copy command produces Error 102: Field is missing. But the global field does contain the proper text string. Is there a restriction on Copy—i.e., one cannot Copy from a global field? If so, do I need to create a separate table just to copy some text to the clipboard. Or am I missing some obvious mistake in my coding? Here is the relevant part of the script:
July 29, 20205 yr Author It wasn't, but it now is. You have solved the problem. Generally, global fields can appear in script steps regardless of whether the field appears on the current layout. The Copy step is clearly an exception. Is there a way to figure out when presence on a layout matters?
July 29, 20205 yr This is not about global fields, but fields in general. When you work at the data layer, the field does not have to be on the layout. However, the editing script steps and most of the fields script steps work at the layout level. Their main purpose is to assist the user with data entry. If you want to set the clipboard at the data layer, consider using a plugin or (on a Mac) AppleScript.
July 29, 20205 yr Author Thanks. I don't have a good feel for the distinction between data and layout. To me, they have always been enmeshed. Is there a help article that explains the difference?
July 29, 20205 yr 17 minutes ago, jjjjp said: Is there a help article that explains the difference? Not that I know of.
July 29, 20205 yr some script steps are legacy which are not much more then a macro that has a dependency to a layout object - (typically copy/paste functions or other things in Edit menu. ) In reference to data layer would mean you could edit data without being bound to a layout however you may be dependent on the schema or relationship. Unless you employ FQL or Plugin to capture data out of context. I am curios why you are copying data to clipboard?
August 6, 20205 yr Author Sorry, OceanWest not to reply till now. I somehow didn't get, or missed, a notification of the reply. I'm copying to the clipboard for this reason. My database manages academic workshops. Though there is a feature that allows users to send an announcement via email to all of the workshop leaders for the current year and a specific program (schedule), sometimes it's just easier to send an email outside of FileMaker on one's preferred mail client. I created a script that produces an Excel file with first name, last name, and email address for columns. But some mail clients, notably Mac OS's, are finicky about having an Excel column copied to the To line. But email clients seem to like comma-separated lists. So my script now also copies a comma-separated list of email addresses to the clipboard.
Create an account or sign in to comment