Jump to content

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

Recommended Posts

Posted

I'm converting from Appleworks' very limited DB to Filemaker 7. I'm impressed with the everything so far--except that I find I can't add pictures or files to container fields by dragging them in from the finder.

Was "drag and drop" never enabled for Filemaker? It's really tedious to enter hundreds of images by going through a series of menu commands: Insert - Picture, navigate to the file through a dialog box, etc.

Posted

Okay, I figured out how to batch-import a folder full of pictures. That's great. But I also want to insert references to a group of Excel and Word files. The batch-import function only works on picture and movie files. I can insert references to Excel and Word files one by one, but only by using the cumbersome menu commands, because I still can't get drag-and-drop to work with Filemaker 7 (or Filemaker 6, for that matter). Does drag-and-drop work for any of you?

Thanks!

Posted

If it is "references" to the files, not embedding the files themselves, you could use the new "file:" & relative filepath syntax in a calculation field. It's kind of weird, because you create what looks like it would be a text result, but the result you choose is "Container." You'd probably want to do this in a separate field than the pictures.

It produces a little icon, with the name of the file, in a container. If your file is in a folder "files" inside the same folder as the database file, the calculation would look like:

"file:" & "files/filename"

It makes sense to break the folder and filenames into separate fields, so you can move the files later, and just change the folder path to re-establish the connection.

Obviously this only works well when referencing a well-organized (as far as location) collection of files. Also, referencing anything is a little different on a network. You have to put the images on a different mounted volume, and use that relative filepath. You're not supposed to have file sharing on the volume with the FileMaker files.

Otherwise it's Insert File one at a time. I don't know that there's an AppleScript command to insert as a file, not these files. Maybe someday we'll get a more convenient way to do this.

Posted

This is very helpful, Fenton. But can you recommend a utility for generating the filepaths, short of entering the folder, subfolder and filenames manually? Is it possible to do this in terminal, using some sort of "directory" command?

C.H.

Posted

Just FileMaker.

GetAsText(container field) as a calculation (Text result) will tell you a lot about the referenced picture. Here's what I get, even after moving a picture:

size:272,492

image:../../_Small_files/Pictures/PicturesX/PicturesX/PicturesX_w_data/images/abduction.jpg

imagemac:/Macintosh HD/Users/fej/Documents/FileMaker/My_FM/_Small_files/Pictures/PicturesX/PicturesX/PicturesX_w_data/images/abduction.jpg

You get the size, the relative filepath (which is exactly what you'd need to reference it via calculation), and the absolute filepath (in my case Mac).

We used to be able to get the path with AppleScript, but now it's cross-platform with 7.

Posted

But doesn't this method for getting a filepath - GetAsText(container field) - assume that the file is already in the container? I was hoping to generate the filepath first, perhaps breaking it into fields: Folder, Subfolder, Filename. Then get the file into the container (or, more accurately, a clickable ref to the file) using the first method you mentioned (a calculation field = "File:"& folder &"/"& subfolder &"/"& filename) where the result is formatted as a container.

This last bit works great, by the way. I've run a quick test of it, manually entering names for Folder, Subfolder and Filename. The question, though, is how to automate the process of gathering all that information. If I could even get a directory listing of filepaths for all the files in a series of nested folders, I know I could strip that info out using Word's Find/Replace function (or even BBEdit's) into a form that could be imported into Filemaker as Folder, Subfolder, Filename.

Thanks again for all your help, Fenton.

Posted

Did you try it? That's the only way to tell if it works. It works for me even after I break the link to the picture by moving it.

You don't need to know the filepath, because you're going to change it. All you need is: 1. the new folder path, 2. the file name

It's the file name that you need. That's easily parsed, 'cause it's what's after the last "/"

If GetAsText(PictAsRef) (PictAsRef is the container field with the reference) works:

Let ( info = GetAsText(PictAsRef);

Right ( info; Length(info) - Position ( info ; "/" ; 1 ; PatternCount(info; "/") ))

)

Posted

I did try the GetAsText(container field) command--it works, but only if you already have a file in that container field. I'm trying to get refs to the files in the container field by the method you first showed me: a calculation field ("File:" & folder etc.) set to format its output as a container.

And I finally figured out how to generate a textfile containing all the filepaths in a folder containing files and subfolders with files: run the main folder through Virex and save the log file!

The logfile has the filepaths all set to go, or you can run them through the "replace all" function in your word processor in order to break the filepath down into folders and subfolders prior to importing the data into Filemaker.

One last question, Fenton:

When I use this method on an image (a calculation field formatted as a container with the formula "file:"&folder/filename.jpg) the image doesn't display properly. All I get is a clickable jpg icon in the "container". Is this the key difference between true container fields and calculation fields formatted as containers? Or is there something I can do to make the calculation/container display the image?

Thanks!

Chuck

Posted

Last question first: "file:" stores a link to the file, showing as an icon and the file name. "image:" stores a link to the file AND shows the image. The main use of "file:" is that it can link any type of file; or in cases where the image file is large and you'd rather not display it.

I don't quite know what you're trying to do about the file names. I assumed you were needing to get a list of the file names from the now broken container fields, which are still holding the reference information.

But, obviously you have the files themselves, in folders somewhere. So now you're just wanting to get a list of their names. There's several ways to do that. Virex, yes, that's a new one. AppleScript or BBEdit (or TextWrangler) can also do that, and Shell scripts.

You can also do this with just FileMaker. The Import folder command doesn't force you to import the picture. You can just import the name. Then you can use your calculation field to show the picture.

Or maybe you already have the file names in the records? We never really established this. But it seems you've got what you need.

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