Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted (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 by Guest
Posted

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

Posted

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?

Posted

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

Posted

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

Posted

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

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