Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Hi, all -

A client is interested in getting a document control system. Before he does, I want to explore the option of using FM Pro for this. There's a template called "Document Library" that is a pretty good start. What he'd like to do is to see a thumbnail of the document from within the database (perhaps we can create this and store it as a separate object), and then be able to open the document from the DB as well.

Is this just a pipe dream, or is there a way to do it?

Thanks...

Posted

There are plenty of ways to do this. First you have to decide whether you want to store the documents in the database or just as references. If you use references, then the referenced file has to be available to whoever is accessing the database. Meaning that if it's on a network file server, then the FMP client machine has to have access to the server. If the FMP database will only be accessed locally, then you can usually just keep the documents in a common folder.

If you store the actual document in a container field, then you have to have your script export the field contents and then open it using the send event script step. If changes are to be made to the document, then the saved document will have to be reimported via a script

Posted

It is certainly doable. There are considerations however. For one thing, it is simplest to store the actual files within the FileMaker database file. But that means:

1. It's in the database file, the whole thing. If you want to modify it, then you'd need to take it out, modify it, then put it back in.

2. That database file is going to get very large. This isn't a huge problem, as the file size limit is massive, as long as that's all you're using the file for. I would not put a table to store a lot of files within another general use file; just make it related.

There are other possible scenarios, if the files need to be worked on often, or if they're used outside FileMaker for other things. But other methods require that you either insert only a reference, which can be broken, or that you calculate the full path to the file (which can also be broken, but which is fixable by changing the calculation path).

The new ability to specify file paths for insert/import/export in FileMaker 8 goes a long way to simplifying working with files. But if you add a little AppleScript into the mix, you can get even more functionality, such as the ability to list a folder of files, and insert only certain types of files, move/rename/delete/zip files, etc..

So, there's alternatives; some decisions depend on how you're going to use the files, whether you're going to modify them, and how often.

Posted

Thanks for the responses, guys. A couple of things I should have pointed out:

1. The target machine is probably going to be Windows -- does the Dark Side have a compatible equivalent to Apple Events?

2. The files stored in the DB are going to be read-only.

3. This DB will be used for storing old business documents (ranging in importance from phone bills to tax records) that are currently only in hard-copy format. I see no reason not to actually store them inside the DB (as opposed to only a reference).

So...if this colors the recommendations at all, please let me know. Thanks!

Posted

On windows you still have the Send Event script step. If you just need to open a document it's pretty straightforward. You can use VBScript to do further automation. If you look around posts here, you'll find a lot of useful information about it.

AutoIt is a free windows scripting/macro language that I like. I find it a little more accessible than VBscript

One downside to storing the documents in the database especially if they are relatively large scanned in documents, is that your database size will baloon as the documents pour in. This shouldn't be a problem with the 8TB limit, but there could be performance issues that you'd want to test for.

I've just started using FM to scan in paper documents and view their contents. I settled on using AutoIt scripts triggered from Filemaker to run the scanner software, then rename the scanned pdf documents with filenames like "serialNumber.pdf" then stored them on a fileserver which is also running a web server.

Now the documents can be viewed using the new web viewer feature of 8.5 from any computer, and they can still be edited from computers having access to the file server.

Posted

Trying to get this working on the Mac first -- there seems to be a problem with how I'm configuring the send event script step. This is what I have:

- Target application is Adobe Reader 7.0.5

- I send the "open doocument" event

- I pass a calculation (not a hard-coded document name) which concatenates the path name and the file name.

Adobe comes back with an error that the file isn't found. Am I doing something clueless? Perhaps the calculation field can't be used for passing a file specification?

Thanks...

Posted (edited)

You can use a variable to store the file path and then use the variable name in the dialog where you specify file paths for import or export of files

Set Variable [$variableName;path/to/file.pdf]

Export [filemac:$variableName

Send Event[filemac:$variableName]

The script would look something like the above (forgive the lack of syntax correctness)

I've attached an example file. I changed the export script to export to a timestamped file in the documents folder

Document_Library.fp7.zip

Edited by Guest
Posted

Hey, Reed -

That example worked beautifully...thanks for taking the trouble of mocking that up for me.

Now that I know how to manipulate the file name/path name once they're in fields in a record, I don't suppose there's a way to populate those automatically when the file is first inserted into the DB?

Posted

just using the getastext() function you can extract the filename and/or path of the file. You will only get the path for files inserted as reference, since files stored in the DB no longer have a path, only a filename.

Here is the demo file with a set field added to the insert file script step. You can see that one of the records has a path while the other has just a filename. Also you'll note that you can't access the file stored as a reference.

Document_Library.fp7.zip

Posted (edited)

OK...so the question that I'll probably self-answer immediately after sending this is...how do you control whether you get the full pathname or just the filename? As it's currently configured, I get just the filename...is there other data "hidden" in the file that's non-obvious?

Thanks...

--

OK...never mind...I read your answer a little more carefully and now I get it. All that remains to be done is some parsing. Thanks a ton for the help, Reed.

Edited by Guest
  • 4 weeks later...
  • 1 month later...

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