Jump to content

Picture References in Database


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

Recommended Posts

I have inherited the support of a FileMaker database. I need to move the database from a MAC to a PC. In the process of moving the database I have identified that pictures in the database are being inserted with "Store only a reference to the file" checked in a container field. Is there are way to view the actual reference to the file and can I replace the reference in a batch update to point at the new location? shocked.gif

Link to comment
Share on other sites

Yes you can -- on the mac with AppleScript. There are some issues with cross-platform compatiblity (look for discussions of this issue in this forum).

An AppleScript for moving images stored as references to files follows. There are 2 fields required for this script: the "Container" field and a global field "Destination Folder" that stores the location of the new folder (you will need to select a location on a networked volume).

tell application "FileMaker Pro"

set theFile to cell "Container" of current record

set theFolderPath to cell "Destination Folder" of current record

end tell

try

set theDestination to alias theFolderPath

on error

set theDestination to GetFolder()

end try

if theFile is not "" then

try

set thePath to theFile as string

on error

display dialog "Image not stored as reference to file " buttons {"OK"} default button 1

return

end try

tell application "Finder"

duplicate file thePath to theDestination

end tell

tell application "FileMaker Pro" to set cell "Container" to the result

else

display dialog "No Image found in current container field" buttons {"OK"} default button 1

end if

on GetFolder()

set NewDestination to choose folder with prompt "Please select a destination folder"

tell application "FileMaker Pro" to set cell "Destination Folder" of current record to NewDestination as string

return NewDestination

end GetFolder

Link to comment
Share on other sites

One thing that I always do when working with container fields which reference external files, is store the reference in a text field too. That way if the link to the file ever gets broken, then you can look at the info in the text field to find the original container data.

Link to comment
Share on other sites

  • 2 weeks later...

You can test by saving an image to the network volume and then set the container field to a reference the image. And then check on the container on the PC. If there is no image, this means the path is different from the Mac to the PC.

Seems like I had read at some point to make sure the network volume is mounted via the IP address. Unfortunately I don't have a mixed platform network to test this out.

Link to comment
Share on other sites

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