Skip 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.

Not able to Copy (to clipboard) from a global field

Featured Replies

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:

786254644_copytoclipboardwithglobalfieldscriptsteps.png.e2e90975dcdb43d520fd0b9fd1aa87ad.png

Is the global field present on the current layout?

 

  • 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?

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.

 

  • 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?

17 minutes ago, jjjjp said:

Is there a help article that explains the difference?

Not that I know of.

 

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?

 

 

  • 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

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

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.