George from Pittsburgh Posted February 20, 2008 Posted February 20, 2008 (edited) My question is very simple. How, (step by step), do I embed a file into a container field. I don't wish a reference since the reference is dropped if I move the files. Thank you in advance. Perhaps I am not being clear. After the insert with no reference I can see an icon of the file, but how does the user open the file? Edited February 20, 2008 by Guest
Søren Dyhr Posted February 20, 2008 Posted February 20, 2008 but how does the user open the file? Try this: Set Variable [ $where; Value:Get ( TemporaryPath )& "my.pdf" ] Export Field Contents [ Untitled::aContainer; “$where”; Automatically open ] If you attach an invisible button to the container field... could the same touch and feel as the referenced files be made! --sd
George from Pittsburgh Posted February 24, 2008 Author Posted February 24, 2008 Thank You Oldhand; it works wonderfully. In an effort to make the script dynamic, I created a field "gContainer" and set it = Get(Scriptparameter). I then set the Field Contents to "gContainer". However, the export step gives me a file error - Couldn't open the file. Any thoughts?
Søren Dyhr Posted February 25, 2008 Posted February 25, 2008 Scriptparamters are only text, you need to use - combination of: http://www.filemaker.com/help/FunctionsRef-37.html ...and: http://www.filemaker.com/help/FunctionsRef-39.html --sd
George from Pittsburgh Posted February 25, 2008 Author Posted February 25, 2008 Old Hand, Thanks for your response; however I can't quite get it. Go to Record [First] Set Variable [$FieldValue; Value: GetField (GetScriptParameter)] Set Variable [$Where;Value:Get(TemporaryPath) & "my.pdf"] Export Field Contents[ What do I put here as a field or how do I make the container field, the active field? ; "$Where"; Automatically Open] I can also get the field contents with; Set Variable [$FieldContents; Value: GetNthRecord ($FieldValue; 1)] I can't see how to pass the ScriptParameter to the Export Contents portion of the script. Further help will be appreciated. George
Søren Dyhr Posted February 25, 2008 Posted February 25, 2008 There are several things wrong here, your error might be caused by extention conflict, the potential field might be a word document, by you have saved it as a .pdf. Then do you ask what to put in the first part since the focus now is a little diffuse and might have 4-5 containerfields in one record, but wish to use the same script for all of them. The answer is to leave it open and loop until the field matches the scriptparameter... Go to Field [ ] Go to Next Field Loop Exit Loop If [ Get ( ActiveFieldName ) = Get ( ScriptParameter ) ] Go to Next Field End Loop Set Variable [ $where; Value:Get ( TemporaryPath ) & GetAsText ( GetField ( Get ( ScriptParameter ) ) ) ] Export Field Contents [ “$where”; Automatically open ] This means that each container field gets an invisible button attached which includes a script parameter telling where it was issued from. Then is there the error you get, it's easiest to use the filename of the stored document hence the 3x GetSomething( , instead of calling it something general and then remember the .ext of the document in the containerfield. --sd
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now