Beyond Text: Container Fields

Beyond Text Container Fields

Words and numbers form the bulk of most databases. All these letters and figures convey important information, but they can be pretty boring. Increasingly, people are using FileMaker databases to store images, movies, and other bits of multimedia. For example, you can store a photograph of each employee right along with her personnel records. Or add product shots to your inventory database.

The Contact Management database has one field you may have been ignoring until now: Image. Unlike all the other fields in this database, the Image field doesn't expect (and won't accept) typed text. It's a special kind of field called a container field. Container fields can hold just about anything you want, including pictures, sounds, animation, music, and movies. You can even put any file from your hard drive into a container field, like a PDF file or a Word document. You can see container fields holding assorted things in Figure 2-21.

Figure 2-21. Container fields can hold any file. If you put a picture into a container field, FileMaker shows you the picture. If you insert a sound file, FileMaker gives you a special speaker icon that plays the sound when clicked. Music and Movie files give you the typical play, pause, fast-forward, and rewind controls, just like movies on the Web. For other kinds of files, FileMaker just shows you the file's icon.

Whether you realize it or not, when you use container fields you're using FileMaker as asset management software. That's the industry term for elaborate, customized software that contains and catalogs huge numbers of images (for use in brochures, books, or Web sites, for example). These programs are essentially databases, and with FileMaker, you can also manage large numbers of the images and documents you use every day. The data in a container field falls into one of four categories: picture, QuickTime, sound, and file.

2.7.1. Pictures

A picture can be in any of more than a dozen formats, including the common kinds like JPEG, GIF, and TIFF, PICT, and BMP. FileMaker will also accept PhotoShop and PostScript (.eps) files. When you put a picture in a container field, the field displays the picture itself.

The following methods for copying, pasting, and inserting pictures into container fields are the same whether you're inserting a movie, PDF, text, or other type of file. You see the same type of Insert dialog box for navigating your hard drive each time.

2.7.2. Copy and paste

The most obvious way to put a picture into a contained field is to paste it in. You can copy a picture from just about anywhere, then click once in the field and choose Edit Paste (Ctrl+V or -V).

You can also copy data from the container field. Again, simply click once on the field, and choose Edit Copy (Ctrl+C or -C) or Edit Cut (Ctrl+X or -X). Whatever was in the field is now ready to paste into another field, record, or program.

2.7.2.1. Insert images/U2192.jpg border=0> Picture

If the picture you want in a container field is stored in a file, copy and paste doesn't do you much good. You'd have to open the file in some program first, and then copy it from thereand that's no fun. Instead, you can insert the file directly into the field without ever leaving the comfort of FileMaker. Here's how:

  1. Click in the Image field.

    You've now entered the record, and the Image field in particular.

  2. Choose Insert Picture.

    Click Open.

    FileMaker grabs the picture and puts it in the Image field.


Tip: If you need to insert lots of pictures into a database, you can save yourself a lot of trouble by using the File Import Records images/U2192.jpg border=0> Folder command. See Section 17.4.2 for the full explanation.


POWER USERS' CLINIC

Store a Reference

When inserting a picture, QuickTime movie, or file (Section 2.7.2.1), the dialog box includes an option to "Store only a reference to the file." When this option is turned off, FileMaker copies the actual file into your database. You can move or delete the original file and the data will still appear in the field, because the database now contains all the file's information within itself. If you turn on "Store only a reference to the file," FileMaker doesn't copy the file into the field at all. Instead, it just remembers the file you wanted. Each time you look at this record, FileMaker returns to the disk and finds the original file so it can display the data. In this respect, it works exactly like a shortcut or alias. If the file is gone (moved, deleted, or renamed), FileMaker will show you this message instead.

There's no simple rule for when you should store the actual file, and when you should store a reference instead. Most people decide to store the file itself, because it saves the trouble of keeping the files and database together.

This is expecially true when multiple people are using the database from different computers. On the other hand, here are a couple of reasons you might want to store a reference instead:

Otherwise, when you're using your database day to day, it usually doesn't matter whether you've inserted a reference or the actual file. For the most part, both kinds work exactly the same. This book explains the differences as they come up.

Just as with a picture (Section 2.7.2.1), you can copy and paste QuickTime movies or sounds into the container field or use the Insert images/U2192.jpg border=0> QuickTime menu command to select a QuickTime file from the hard drive.


Note: FileMaker lets you copy and paste either entire QuickTime files or sections of footage or sound that you've selected before copying. To do so, just open the file in QuickTime Player for Mac or Windows and use the movie controls to select the desired snippet.


2.7.4. Sound

A sound is a recorded bit of audio. FileMaker actually lets you record sounds right into the field. You can keep audio notes with a project record, or record your practice speeches and save them for when you're famous. When a container field holds a sound, it displays a little speaker icon; double-click it to hear the recorded sound.

2.7.4.1. Recording sound

The Insert Sound command doesnt bring up the same dialog box as the other Insert commands. Instead, it shows the Record dialog box (Figure 2-22). If your computer has a microphone attached, you can record any sound directly into the field.

Figure 2-22. FileMaker records sound from the sound input device you set up in your control panel (Windows) or System Preferences (Mac OS X). Most computers let you use more than just a microphone as the sound input device. For example, you can usually record sound from audio CDs in your CD-ROM drive or DVDs from your DVD drive.

The Record dialog box is simple, but capable. The speaker icon provides feedback about what the microphone's picking up, by showing little soundwaves indicating the sounds it's hearing. The more soundwaves you see, the louder the recording. In fact, the speaker icon lets you check for soundwaves even when you're not recording, so use it to do a quick sound check ("Testing, testing, 1, 2, 3"). If you don't see waves when you talk, make sure the microphone's plugged in.

When you're ready to record, proceed as follows:

  1. Click the Record button.

    FileMaker immediately begins recording everything the microphone hears. As it does, the Recording Time progress bar fills slowly. When the progress bar reaches the end, you've recorded as much as you have room for.

  2. When you're done recording, click Stop.

    At this point, you have some sound recorded. The length of the recording shows to the right of the Recording Time progress bar.

  3. To hear what you got, click Play.

    Once the recording is playing, you can use the Stop or Pause button to stop it. Clicking Stop will stop it completely. (The next time you press Play, it starts over from the beginning.) Pause, on the other hand, lets you stop the playback momentarily. (Clicking Pause or Play again starts the playback right where it left off.)

  4. If you're satisfied with what was recorded, click Save to store the sound in the container field.

    If you click Cancel, FileMaker completely erases the sound you recorded with no warning…so be sure you click the correct button.


Tip: The Insert Sound command is specifically for recording sound directly into the field. If you have a sound file of some kind already on your hard drive (an MP3 for example), choose Insert images/U2192.jpg border=0> QuickTime instead. In general, if the data youre putting in the field has a time component (meaning it happens over time, like video or sound), treat it like a QuickTime file.


2.7.5. File

A container field can also hold a file. Since FileMaker doesn't know what the file is supposed to be, it simply shows you the file's name and icon. Unfortunately, you can't do anything with a file like this while it's in FileMaker. You can't edit it. You can't even open it and view its contents. Rather, the Container field simply holds the file for you. (Soon you'll learn how to get it back out.)

GEM IN THE ROUGH

PDFs in Mac OS X

The ability to store pictures, movies, sounds, and files in your database can be useful for lots of reasons. For example, if you're a recruiter, you could store resumes in Microsoft Word or PDF format right in the database alongside the info about a particular candidate. In fact, the Adobe PDF format is so common that people often need to keep track of PDF filesthe brochure, flyer, or documentation for each of your products, the prospectus for each of your investments, or a floor plan for each of your properties.

You already know you can use the Insert File command to store the PDF document right in a container field (and get it back out again later to look at it). But if youre on Mac OS X, you can do one better. Choose Insert Image and then select a PDF file. FileMaker then shows you the PDF (the first page of it, anyway), right in the container field. If your document has more than one page, you need to export the PDF out of the container field (Section 2.8) to read the whole thing.

QuickTime instead (Section 2.7.2.1).

If you need to search within a PDF file, try this. Open the PDF file, select all the text, copy it, then paste it in a regular text field. FileMaker can search the text field, but you can view the PDF in all its glory in the container field.

If you can't use the file in FileMaker, why put it there at all? Sometimes people need to keep track of lots of files. They might need to organize them in ways that make sense only to their business. Keeping all these files in a folder on your hard drive can be a real drag since they can be slow to search and hard to reorganize. With FileMaker, you can keep the files right alongside other important data. For example, you can store project specifications (in Microsoft Word format) and diagrams (in Visio format) in your database along with tasks, team members, and timelines.

POWER USERS' CLINIC

Getting the Most Out of Your Fields

The Edit Export Field Contents command isnt limited to container fields. With very few exceptions, you can export the contents of any field to a file. By contrast, you can't export a sound you recorded in FileMaker and you can't export the contents of a field you can't click into. (To help understand why you can't click in some fields, read about field behavior in Chapter 6, and security in Chapter 16.)

Here are some examples of how to export to your advantage:

  • Use Edit Export Field Contents to create a file without having to retype what youve stored in FileMaker. But if you just whiz by the Export Field Contents dialog box without looking, you'll miss a couple of options that will save you buckets of time. If you want to watch a QuickTime video at a size larger than the skimpy container field, just click the "Automatically open file" option as you export the contents of your field. FileMaker creates a duplicate video file for you, then opens a QuickTime player for your viewing pleasure.
  • In fact, FileMaker is smart enough to open the right program for whatever you've exported. You'll get a text editor for text, a PDF viewer for a PDF, or a graphics viewer for graphics. Best of all, you don't have to scramble around looking for a program that can handle your file, because FileMaker figures it out for you.
  • If you want to spread the wealth aroundlet your colleagues know about a customer who always makes a big order at the beginning of the new quarter, saythen turn on the "Create email with file as attachment" option when you export your field contents. FileMaker makes a file (hey, that makes sense!), then launches your email program, starts a new email, and attaches your new file to the email. All you have to do is type in a name, subject, and some text, then send the email on its merry way.

Let FileMaker really impress you by clicking both options at once. You'll get a copy of the file open for reference and a fresh, shiny email nearly ready for sending. If you've got the screen real estate, you can look at both these little jewels while you're checking out the FileMaker record that spawned them.

The most common way to place a file into a container field is to use the Insert File command. On Windows, you can also copy a file on the desktop and paste it into a container field. When you insert a file, FileMaker makes no effort to figure out whats in the file. If you choose a picture, you'll still get just the name and icon. If you want to see the picture itself in FileMaker, you must choose Insert images/U2192.jpg border=0> Picture, as described on Section 2.7.2.1.

2.7.5.1. Exporting data from container fields

Inserting files into container fields is all well and good…but it's just as important to get them back out again. When you use the Insert File command, all you get to see is an icon and file name. Copying the file from the field with Edit images/U2192.jpg border=0> Copy, doesnt even do you much good, since FileMaker can't paste files to the desktop where you might actually be able to open and read them. A better way is to use the Export Field Contents command. Just click in the container field in question, and choose Edit Export Field Contents. FileMaker asks you where you want to put the file, and what to name it. Click Save, and FileMaker creates a new file thats an exact copy of the one you put in the container field.

Категории