Jump to content

One way to view documents in a container...


MK
 Share

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

Recommended Posts

There have been several posts here (and elsewhere) regarding the fact that there is no built-in way (in FP7) for the user to view documents inserted into container fields (I am talking about embedded documents, as contrasted with documents inserted with a reference to its path. The latter category can be viewed by a double click). Many people want to include their documents with their database instead of storing them elsewhere on their HD and using a reference.

After some thought, and much help from the experts here, the solution is actually quite simple. In my case, it looks like the screenshot below.

As you can see, I set up a container field. Below the field are three buttons. The first, Import Document, is a simple "Specify Button" telling it to "Insert File" into the target field. The second button, "Export Document" is also a "Specify Button" telling it to "Export Field Contents". I do not specify the output file as this allows the user to change the name if they so choose.

These first two buttons are obvious and are the method that FileMaker suggests in its tech note. It's the third button that solved my issue with the usability.

The third button performs a two step script that reads as follows:

Step 1: Export Field Contents (here, I specify the target field and the output file. The output file is a file on the desktop which I have named "FileMaker_Export". You can call it anything you want as it is only a temporary file).

Step 2: Perform AppleScript [ Native AppleScript: tell application "Finder" activate open file "FileMaker_Export.pdf" delete file "FileMaker_Export.pdf" end tell ] (here, I run a simple AppleScript that tells the finder to open the temporary file I created and then delete the file. This allows you to view the file)

So far, this is working perfectly for me. I have only used it on PDF files using Apple Preview as a viewer, but it should work with other types of files (of course, I am talking about Mac only since AppleScript would be fairly useless on a Windows machine).

Kindest regards,

Mark

Picture 2.jpg

Link to comment
Share on other sites

It would be nice if there were more consistency in this implementation of files stored in containers.

You need this sort of work around to open a file stored in an internally stored container field if you are a OS X user. Under XP, however, you can open a file by double clicking on it -- if it is store as a file reference. With XP as well, the externally stored file reference can also be opened using the Go to Field Select/Perform script step. Over the web using IWP, you can open a file with a single click -- if it is internally stored -- but not if you are accessing the DB using IE Windows XP. With XP IE you need to save the file and then open it.

Link to comment
Share on other sites

You're right, AppleScript is no longer needed for this. I guess we got off on the AppleScript tangent without really thinking about the new possibilities in 7. He asked about AppleScript, and it's what I'm used to using.

It seems to the same in OS X. You can open it by double-clicking it, or with Go To Field [select, Perform] -- if it is a reference, not if it is embedded. This makes sense, because when you embed it you're inserting the whole thing and saying "forget about where this came from." You can also open it if it is calculated, with the "file:" prefix and a relative path.

It does have to be enterable however.

Link to comment
Share on other sites

One last little "gotcha." Go To Field [] will no longer enter a field whose Field Format was set to not allow entry. That's going to block lots of value lists, etc. in converted files I should imagine. I know I used it for this, to lose the "squiggles" around the field.

Link to comment
Share on other sites

I (stupidly) wrote: "You're right, AppleScript is no longer needed for this."

We've come full circle. It is still needed, if it's not a reference (which the original poster clearly specified).

I wouldn't imagine FileMaker building in an automatic export and creation of a file. I imagine you could use the Send Message step on PCs to open the file.

One day perhaps FileMaker will include a simple cross-platform "Open file" step, and a Save as File step, and ...

Link to comment
Share on other sites

I am using WinXp. Is there som way to go around this by using "Insert Object" (OLE)? Because if i insert a file (embed) with the insert object then i can open the file just by clicking the container. Do anyone of you experts have any idea to use this scriptstep for WinXp.

I would like the user to be able to browse to a file to insert (like insert file script step). If i use the insert object i have to specify a file to insert (if i dont want to insert a new). Is there some way to trick FM? If i point the script to a "fake file" that opens Explorer so that i can insert a file that way?

Of course i would like my users to browse to the file (and not have to choose if it should be a reference and what kind of file-type it should be). ie it should be like MK

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...

I'm still none the wiser. How can I, as a Windows user, open files saved into the container field. Surely this is a frequently asked question but I can't seem to find any posts that solve this question. Please help.

Link to comment
Share on other sites

I am a huge advocate of the PDF and have links to files like that and others like mp3 or .doc and MAC formats. The best way i've found to view those is with a plugin called launchit. It takes some homework but their samples alone can be used for most applications and then linked to your master file. OUtside of that i'd like to hear more about the above comments on .fdf's. Unfortunately i think that user may have mis understood your question since .fdfs typically refer to acrobat forms data.

Most of my linked files in containers are launched with a script to open the linked file in the container.

I keep hoping an expert will answer your question with an outstanding solution right in Fm pro just like a browser plugin!!

Good luck!

Link to comment
Share on other sites

  • 1 month later...
  • Newbies

Will this three button solution work with a central database hosted on a computer running FM7 Server? We have five client workstations (all on OS X) accessing a single database on a stand alone G4 machine running FM Server. All client workstations need the ability to "Insert File" into the container fields, and to quickly view the documents once stored there.

Link to comment
Share on other sites

This topic is 6422 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
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.