1 of 1 people found this helpful
Create another container field, setting this one to store the file rather than reference. Create (or use existing) layout which u can view all records, then create a script or a button with a single script step that calls replace field contents. Set the target to ur new field, and the src to ur referenced container field. Check the box so it doesn't nag u each record. Press the button. Should be good. Save a copy of ur base bfrhand.
That sounds possible, I'll be giving it a try. Thank you, Vince
Steve, I have set up a new container field, and begun to create a button and or script. I have set the target field to the new container, I don't see an option to select the source? (referenced container field). It looks like this will replace all 832 records with one 'like' image. In my case each record has a different image associated with it.
The last of the three options replace field contents gives you is to replace by calculation.
This is what u want. U r replacing the contents of the newly created container (which is going to be empty in all records), with the contents of ur original container (which referenced a file).
In the calculation, u just need to enter the fieldname for the original field.
In answer to ur last question, if u check the Box to do without prompting you, it will shred thru the entire found set and replace the field in all records without asking u. When the script ends, u will be left with all of ur records containing the file each record previously referenced, stored in ur new container field. Once u have verified that all went well, u will be able to erase ur old field and just keep the new one.
If u want to step thru the script one at a time, don't check the box.
Happy to send a quick demo if u want to look at what I'm talking about.
Thanks for the answer, I think I follow your explaination. If it is not too much trouble your demo may be helpful.
thank you for your help, Vince
FYI, FileMaker 12 completely reworked how container fields work so that it feels like you have stored a binary file in a container field when it is really stored externally in a secure folder. It keeps the file small and nimble while making sure the image does not loose its reference location. If you have to do much with container fields, you should reallly consider upgrading to FileMaker 12.
Also, if you play with images much, there are some great image plugins. I recently started using the Monkey Bread Software plugin for image manipulation. For example, it can evaluate the size of your image and if it is too big, it can reduce the pixels or it can increase the compression. It can convert between several images types (jpg, png, gif....). And one feature I like a lot is the ability to rotate a picture inside the container field. The MBS plugin does many other things and has about 1200 functions, but the image functions by themselves are worth the cost to me. One more thing, FileMaker makes pushing out plugins to client machines much easier than the old Auto Update in FM 11.
Best of luck with it and let us know if anything doesn't work.
Heres a demo.
I had to modify my original advice as the result it produced was referenced as well, not stored.
I'm so used to handling container data using fm12 that I had to fire up 11 and poke at it a bit.
i left both approaches in the demo so you can see what I am talking about.
for what you are trying to do, I would give some thought to upgrading to 12.
the container system is much more robust and was designed to meet this very need.
you may find that your solution starts to get slow as you load up files.
but - depending on your forecasted load, it may work just fine.
in any event, hope this gives you some ideas on approaching your goal.
rfc.zip 11.0 MB
I'll have to take a closer look at this, at a glance it looks good. I want to study the scripts and adapt it for my application. Thank you for walking me through.
I am working through the scripts editor trying to adapt (insertimage_found Set) for my data base.
In the fourth row in script editor you have "#". I am not familiar with this function nor can I find a way to enter it into my script. Would you school me about this?
I've been giving some thought to FM 12, I have 11 running on 2 machines, not sure if I should upgrade both at this time.
thank you, Vince
The # is first character of the comment function. I use it to divide up script blocks into logical "blocks".
If u dbl click on it and start typing , these comments will be inserted.
It is completely benign and not needed.
Were u able to use the insert script to get ur files onboard ?
Upon completing my script and implementing it I immediately get this dialog box. The file "$file" could not be found and is required to complete this operation. Then the dialog box; The previous script step, “Insert Picture”, could not be completed because of an error. Do you wish to continue with this script? The loop continues or click cancel.
In the script the line Set Variable [$file;Value:replacefieldcontents::referencedContent] if you click the Specify button, a box titled "Set Variable" Options appears, here in the line, Name: I have entered $file .
In the line Value: I have clicked Specify and chosen my referenced field. In my case it open the calcutations dialog box and the variable looks like Art Data '04::Pict . (this is my data base name :: and the referenced container field)
In the "Insert picture" line click specify, Specify Picture File dialog box pops up, $file appears in the box, clicked OK. It appears the same when I look through your scripts for (replacefiledcontents).
So somewhere I have made a mistake, be darned if I can find it.
The insertImage (all records) script [insertimage_foundSet] is the script I have been working from and the result has been the the two dialog boxes I referenced at the beginning of this reply.
thanks Steve, Vince
hmmm....it sounds like the script is getting tipped over on the first step looking for the file. when it can't find it- it is causing all the subsequent steps to fire without their needed variable value intact. if you want me to take a look at it, I'd be happy to...you cld send it to me without the files.
Thank you I will be sending it off soon. Vince