Don't know of a way to drag an object from outside filemaker and drop it into a container field :smileysad:
If you store the file in the container "by reference" you can then open the file by double-clicking the container field.
If you must have the file physically stored in the container you can script the export field contents process. You can even make your container field the "button" that you click to trigger the script.
Great, thanks Phil! Too bad about the drag and drop... that would be really handy in cases where someone sends you an attachment (i.e. resume) that you want to add to a record.
Would you mind giving me a step by step on making a container a button? That would be way easier than having to save to a folder/desktop before opening!
Simply select the field while in layout mode and select Format | Button Setup... and you can treat a field just like a button. Be aware that this button setup will keep you from clicking on the field and using Insert to insert the file in the first place. You'll need a separate layout for inserting files or you should place a button next to the container field and use it to open the file.
Yes, we'll need to be able to insert files, maybe the button beside the container field would be the way to go.
Could you outline the script that I'd have to associate to the button, to open the file?
Fenton Jones posted an excellent script for this which I've modified to make it applicable to all file types:
Allow User Abort [Off]
Set Variable [ $filepath; Value: Case ( Abs ( Get ( SystemPlatform )) = 1; "filemac:"; "filewin:" ) & Get ( TemporaryPath ) & GetasText(Table::Container Field) ]
Export Field Contents [ table::container field; $filepath; Automatically open ]
Pause/resume Script [ Duration (seconds); 1 ]
Export Field Contents [ $filepath ]
The second export field contents step is supposed to delete the newly created file. I've found that it deletes the file if I specify a folder on my desktop but for some reason it didn't delete it from the Temporary folder. It's still an excellent way to pop open a file that isn't stored by reference.
That's weird - I didn't expect it to work, but I just dragged a jpeg from my desktop and plonked it into a container field, and it worked perfectly - even replacing the existing document that was already there. (Without warning, be that good or bad.) I was curious whether it had defaulted to a stored copy, or a reference only, so I double-clicked it and it showed me the full path name to the document on my desktop, inferring to me that it was 'by reference only'. So I changed the document name on my desktop and double clicked the container field again. It showed me the same (original) document name and location... and opened it anyway. So I have to assume that the full path-name is only a reminder of where it was sourced from, but it is in fact now copied into the container field.
By the way, from my experience storing the documents inside a FM field will explode the file size very quickly, to the point where I've never seen it actually be manageable, but I really appreciate the 'Store as reference' feature.
PS: I was inspired to even try it because I used the FM Graphics pack, and you can use it the opposite way - have the file you're designing in Layout mode, and the Graphics File in browse mode. Just drag the browse-mode Graphics File container field on to the layout you're designing, and there it is. No copy-and-paste needed.
I agree that's weird. I thought I'd been told elsewheres that drag and drop into container fields wouldn't work from outside Filemaker. Even weirder is that If I use insert document, I can't double click the container field to open it. If I drag and drop, I can. The file is definitely copied to the field as edits made to the original don't show when you open the container's copy by double-clicking.
Just did a little more checking before posting. Apparently, drag and drop performs an Insert Object operation. If you use insert object to store a file in a container, you get a copy stored in the container and it can be opened via double clicking the file. If you use Insert File, you can choose either by reference or to store a copy. If you store a copy, however, you can't open the file by double-clicking the field. You have to export the field contents instead.
Umm, it's been a while, but I was helping a Library District on an Assets database, primarily photographs.
I set up a series of fields Platform, ServerField, HDField, FolderField01, FolderField02, FolderField03, Filename+extension.
A calculation field was used to concantenate.
This is from memory, not exactly accurate.
The platform was found by Filemaker, the Filename was extracted from a referenced import
The idea was to allow the data to be moved from server or harddrive or folder and allow a replace command to update all the referenced documents. Win and Mac, photos, movies, pdfs, docs, and other file types were tested.
It worked really well.
Humpf, just been having a similar problem too.
I have lots of PDFs to add to a medical database - we scan different parts of the notes seperately eg referral letter, clinical notes, operation notes and anaesthetic charts.
What I have been doing when scanning the seperate parts is to use the hospital number with what the document is as the file name eg XX123456_referrral_letter.pdf
What I was thinking of doing is having a folder system on the server eg
Server\PDFS\anaesthetic charts etc
What I then thought was that with some smart calculations i could dump the PDFs in the correct folder then they would appear in the database.....
This is slightly complicated by the fact that there is more than 1 hospital number for each patient in a seperate (related table) - HOSPITAL NUMBERS::Hospital number and HOSPITAL NUMBERS::Hospital
So, the calculation would need to take this into account too.... Also I thought if there wasn't a file there for that container with the specific filename a boolean calculation could then display a graphic that says "Sorry there is no PDF available". Eeek this is getting really complex!
My head is hurting...
The issue I have is that there are a lot of PDFs to add to the database (thousands) adding them manually is going to take a long time even with some smart layouts!
When I drag and drop them into the container field they are embedded/loaded into the database rather than just linked; again this is taking a lot of time and is making the database huge - some of the PDFs are quite large - up to 90mb each - in fact there is over 2gb of PDFs to add into the database. What seems to be happening when FMP save the file within the database there is an exponential growth of the datbase filesize eg if i add 100mb of files the database increases more than 100mb (seems more like 300mb).
I am not sure where to go with this.... any suggestions??
Hello I am Bill
I am fooling with a File Maker program right now.
I plan to have an Apple script enter each pdf I place in an action folder, into filemaker automatically. By turning the folder I place the files into, into an action folder or "actions enabled" folder. It will move them to a final resting place and enter them into Filemaker.
The pdf's will link into a Quicktime container field. So that you can quickly and instantly look at multi page pdf's, using the arrow keys at the bottom of the Quicktime container field. If I ever need to print or look at the document in its original form, through Adobe Acrobat, I can just export the Quicktime Container link, and have it open automatically in Acrobat. And the original pdf that is moved and or renamed will show up in Adobe Acrobat.
This is the only link I could find with my home search engine, if I get a chance I will search for the Filemaker Apple Script link tomorrow at work. I find I get two totally different search results. One on the home Windows machine and the other on the Mac at work. Strange if you ask me. And it is not like one is better then the other. They just find two similar but totally different sets of information.
I have found things at home that I could not find at work and visa-versa.
You can drop PDF and doc files into a container field with no problems in more recent versions of FM
And in recent versions, Insert Object, does not exist.