April 18, 201213 yr I have a layout with a container field that stores paths to jpeg files. I'm trying to write a loop script that works through a found set and opens all the referenced jpegs. The 'open file' script step only opens filemaker files, as far as I can tell. I have the rest of the script constructed, I just need to know how to request that a referenced file be opened. Would appreciate any help. Jon
April 18, 201213 yr I just need to know how to request that a referenced file be opened. You can use Send Event or check out a plugin such as Base Elements.
April 18, 201213 yr Author Thanks for the quick answer, Russell. I didn't know what Send Event was for. Now I'm trying to figure out (without any programming knowledge, unfortunately) how to use it to actually find and open the relevant file. So far no luck. Any tips for this? Thanks, Jon
April 18, 201213 yr Two options you might look at are: the Export Field Contents script step, which has a checkbox preference to open the file after saving, look in the path options. Also look at the Open URL script step.
April 18, 201213 yr Now I'm trying to figure out (without any programming knowledge, unfortunately) how to use it to actually find and open the relevant file. So far no luck. Any tips for this? Both methods would require you to set a variable containing your path to open the file. Search your Filemaker Pro Help for "Creating file paths". Fitch mentioned two good methods too.
April 18, 201213 yr Author Hmm. According to Filemaker help, "variables are not supported in file paths that are stored in container fields". Will have to look at changing the field type, if I can do that without losing all the stored paths. Back to the drawing board...
April 18, 201213 yr Hmm. According to Filemaker help, "variables are not supported in file paths that are stored in container fields". If you select Store only a reference to the file, one way to see the location of the file on your hard disk is to create a script using the Get(ActiveFieldContents) function.
April 19, 201213 yr I just need to know how to request that a referenced file be opened. You could simulate double-clicking the container field as: Go to Field [ Select/perform; YourTable::ContainerField ] Alternatively - and IMHO, preferably - use the Open URL[] step with the following calculation = Substitute ( GetValue ( YourTable::ContainerField ; ValueCount ( YourTable::ContainerField ) ) ; [ "file:/" ; "file://" ] ; [ "filemac:/" ; "file://" ] ; [ "filewin:/" ; "file://" ] ) This has the advantage of not activating the container field - in fact, it doesn't even need to be on the layout. --- NOTE: if your container field stores a reference to an image (as apposed to a file), you'll need to adjust the above calculation to have the returned URL follow the file URI scheme. Edited April 19, 201213 yr by comment
Create an account or sign in to comment