Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

  • Newbies
Posted

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]

Posted

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.

  • Newbies
Posted

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

Posted

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]

Posted

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.

This topic is 5420 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.