Note: Insert Object is not supported in FileMaker 12 and is unlikely to be supported in future releases. In FileMaker 11, it's a windows only menu option that uses OLE.
First define a container field and put it on your layout.
Then define your button to do an insert object step and specify your container field.
All script steps that start with "insert" will fail to work if the specified target field is not present on the current layout. For Insert Object, the field must be a container field.
Thank you for your help.
I have created some buttons with different functions in the past, but with this one I am having particular difficulties.
My field is a container field and is part of the layout. I can use it as intended if I right-click on it and select "insert object" and then going through all the steps to point to the desired file/object. The file is added to the container field and I can then access it by double-clicking the field. So far so good.
Where I am stuck is in writting the script for the button. I create a button on the layout and then I am trying to write the script (through "File" -> "Manage" -> "Scripts" window. Here I created a new script where I added the "Insert Object" command, but the only option I get with this command step is to specify the object, which I do not want to do because this is variable and is what the user should be selecting.
I am sure I am doing something wrong, because even after assigning this script to the button, it does not work (there is no action when I click on the button).
Am I missing additional commands in the script to specify the target field? How can I do that?
I have to come back just to ask one more thing relative to this:
When using the "Insert Object" script step, is it possible to further specify it so that the command goes directly into "Create from new" and "browse" - in other words so that it opens the "Select File" GUI from windows without the user having to select it everytime?
Not as far as I know.