Jump to content
Server Maintenance This Week. ×

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


This topic is 1371 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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 comment
Share on other sites

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 comment
Share on other sites

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 comment
Share on other sites

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 comment
Share on other sites

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 comment
Share on other sites

This topic is 1371 days old. Please don't post here. Open a new topic instead.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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