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

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

Recommended Posts

Posted

I am running FileMaker 9 Advanced on OSX 10.5. I have a image database which contains references to images stored on a network drive.

Is there a script I can write which can export each record to a single folder that I specify?

Mark

Posted (edited)

Are you saying, I want to export all the images to one local folder, which I have?

You'd want to set a script Variable, to a FileMaker syntax full file path for each image. So it would need to be reset for each record, in a Loop. Then Export Field Contents using that $filepath as the file path (example variable name, you can use whatever). Just type $filepath into the box, no quotes. If you don't know what I'm talking about, do a search here.

Say the folder is called, "Imported_Images", on your Desktop. Script (partial anyway)B)

Set Error Capture [On]

Go To Record/Request [First]

Loop

    Set Variable [ $filepath; "filemac:" & Get (DesktopPath) & "Imported_Images/" & File_Name ]

    Export Field Contents [ container field; $filepath ]

    If [ Get (LastError) ≠ 0 ]

        // You may not have the folder; you'll still get a dialog, but hopefully the Loop will stop

        Halt Script

    End If

    Go To Record/Request [Next; Exit after last]

End Loop

File_Name in this case being a FileMaker field with something like "Donuts.jpg" in it. If you do not have that, you can pull the name from the Container field. It would be in the 2nd value of the info for the container field (well, in the 3rd also, but easier to get from the 2nd; with a networked image it does not put the folder path to the image in the 2nd line).

Substitute ( GetValue ( GetAsText ( Container field); 2); "image:"; "")

Edited by Guest

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