October 24, 200322 yr 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?
October 24, 200322 yr 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
October 24, 200322 yr 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.
November 4, 200322 yr Author Will this work if I run the script on the Mac and then move the database to the PC?
November 5, 200322 yr 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.
Create an account or sign in to comment