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

Copying data between files via a script

Featured Replies

  • Newbies

I would like to write a script to copy data from one file into another. The manual explicitly states that Variables do not keep their values when you go into a new file, so I am using the clip board.

I have a relation between the files, but the link isn't established yet, that is what I am trying to do. Generate the common index key, go to the other file, create a new record, populate the key, then come back and copy some data (a picture)

The end goal is to remove the pictures from the main file and put them into an external file to cut down on size of the main file.

Thanks for your help

Keith

[email protected]

You an use Exit[calculated value] and Get(ScriptResult) to transfer text data.

If you have many records to transfer, it is probably worth your time to export the info to an external file and import from that file into the second database. If you use the FileMaker format for export, you can include your images also.

If these two databases are on the same system you might simply import directly from the first database into the second database.

If your goal is simply to reduce the size of the original database file, you should probably just use references to external picture files instead of storing the images directly in the FileMaker.

  • Author
  • Newbies

Some of that helps, I am having a hard time even with the simple stuff. It doesn't seem to work right, then every once in a while, it might work partially.

The problem is I have large file with a lot of pictures, I need to copy-paste them into a new file of JUST pictures (and and index and small amount of meta data). I want to somewhat auto-mate this, i.e.

create Key Index

Set key index in old file

go to new file, create new record

set the key index their

paste the picture into the container field

set some meta-data

and that is about it.

The meta data is done using

SET FIELD [Pictures::FileName; "Hard-coded-name"]

And that doesn't even work.

I can't even get the index to transfer if I put it on the clip board. I know it got there because when the script exits, I can paste it someplace else and it is correct.

Any sugestions?

Thanks for your input.

Keith

The problem is I have large file with a lot of pictures, I need to copy-paste them into a new file of JUST pictures (and and index and small amount of meta data).

Why don't you simply import them directly from the source file.

In any case, to pass a value to another file, use:

Perform Script ["New Record" from file: "Targetfile"; Parameter: YourValue]

In any case, to pass a value to another file, use:

Perform Script ["New Record" from file: "Targetfile"; Parameter: YourValue]

Oh right. Sorry about the ExitScript[value] recommendation. Temporary brain spasm.

Use Perform Script as described above and pass a parameter. In the script being performed, use Get(ScriptParameter) to read the text passed.

  • Author
  • Newbies

Thanks a lot!!! This worked.

I can't go back to the source file because in many places they don't exist.

Keith

Create an account or sign in to comment

Important Information

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

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.