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.

copy multiple items to clipboard

Featured Replies

Hello all,

I need to copy/paste single contact record info out of filemaker and into the mac clipboard.

To do this I've created a calc field to concatenate the various fields into an organized text string with line breaks.

I have a little script to put the contents of said calc field into the clipboard.

So far so good.

Here's the thing I can't figure out: related fields - specifically tel numbers and the tel number tags stored remotely and called in by a contact ID number relating the files to each other.

How can I get all the related records (list of telephone numbers with tags) into my calc field for pasting?

Thanks so much for your help.

You don't necessarily need a calc field, you can calculate the AppleScript like so:

"set the clipboard to " & Quote( contacts::name & " " & contacts::etc )

To get the related info, if it was just one field, you could use the List function. With two fields, you could create a calc field in the related file that concatenates the two and then use List on that. Or, you could script it using a Loop:


Set Variable( $count ; Count(related::phone) )

Set Variable( $i ; 0 )

Loop

  Set Variable( $i ; $i + 1 )

  Exit Loop If ( $i > $count )

  Set Variable ( $text ; $text & ¶ &GetNthRecord( related::phone ; $i ) & GetNthRecord( related::tag ; $i) )

End Loop

  • Author

Fitch

Thanks - I'll take a look at the List function.

By "AppleScript" do you mean just that - AppleScript outside of FileMaker? It's been a while since I messed around with that! :)

No, he means AppleScript inside FileMaker, using the Perform AppleScript step, which can accept either a FileMaker calculation field or the text of the AppleScript (which is then compiled upon closing the window). If you use a calculation field, then you must escape any quote marks that you want to pass to AppleScript, include returns where necessary, etc..

In other words, AppleScript transcends the boundaries of applications (kind of mystical :)-), especially in FileMaker's case, which can contain the AppleScript code within one of its objects (I don't know of any other app that can do this, though some are "recordable," which is a whole 'nother thing).

Basically you'd be using it to set the clipboard directly, rather than using a Copy step; which you also could do.

Another place you might want to look is at Brian Dunning's Custom Functions list.

http://www.briandunning.com/filemaker-custom-functions/list.php

There is one called "GetRows" (also requires "GetNthRow") which can produce a text result of what is in a portal, multiple fields, multiple lines, without having to create a concatenated calculation field. You can even use a tab separator, if you copy/paste one in.

  • Author

Ah - of course. I remember dabbling with embedded Applescript years ago.

The add-on function looks promising - thanks for that link. :)

  • Author

OK my friends - thank you so much for your help. The custom function is workin' like a charm.

Except... I'm stuck on the following:

Is there a way to define N in the above function dynamically? The portals the function is reading from don't have a predicable number of records shown. I'd like to copy all of them each time the function is invoked.

Use Count ( related::contact ID ) as N.

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.