Jump to content

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

Recommended Posts

Posted

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

Posted

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

Posted

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.

  • Like 1
Posted

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.

Posted

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...

Posted

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.

Posted (edited)

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 by comment
  • Like 1

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