To run a batch file you have to save it on disk first using the Export Field Contents script step. It works best if the file is a real file, not text; if it's stored as text, the resulting encoding will be UTF-16 and I'm not sure this will work for batch files.
Once the file is saved on disk, you can run it with Send Event script step. The open Event will do, I guess, but it's also possible to execute an arbitrary system command this way.
The hardest part is to get back the results; the only way I can think of would be to write them into a file and then import the file back to FileMaker. To do this within a single script, you might have to add a pause between Send Event and Import script steps.
Thanks Mikhail, thats exactly how I have done it so far although what I was actually asking is if it was possible to open/send an event from a file within a container field.
When you "send an event", the program prompts you to select file, calculation or text. When choosing "file" it asks where on you PC/Network this file exist. I wish to run the file from within a field within a specific record so I can use the same script for every customer, as each customer will have a different batch file.
Do you know if this is possible?
I have figured it out.
You can do this by using the "calculation" option.