jjjjp 0 Posted July 29, 2020 Share Posted July 29, 2020 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: Link to post Share on other sites
comment 1,775 Posted July 29, 2020 Share Posted July 29, 2020 Is the global field present on the current layout? Link to post Share on other sites
jjjjp 0 Posted July 29, 2020 Author Share Posted July 29, 2020 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? Link to post Share on other sites
comment 1,775 Posted July 29, 2020 Share Posted July 29, 2020 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. Link to post Share on other sites
jjjjp 0 Posted July 29, 2020 Author Share Posted July 29, 2020 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? Link to post Share on other sites
comment 1,775 Posted July 29, 2020 Share Posted July 29, 2020 17 minutes ago, jjjjp said: Is there a help article that explains the difference? Not that I know of. Link to post Share on other sites
Ocean West 172 Posted July 29, 2020 Share Posted July 29, 2020 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? Link to post Share on other sites
jjjjp 0 Posted August 6, 2020 Author Share Posted August 6, 2020 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. Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now