I am writing an applescript to open files stored in containers now that the double click option has been removed. My question is how can I import the file name into a text field to include in the applescript calculation?
Just create a calculation (or use auto-enter) that is text and calls the container field. This is the same info as GetAsText(containerField).
The file name should be the first "line", so GetValue() will help here. You want what's after the ":".
This worked for me to show just the file name in FMP12:
GetValue ( Substitute ( GetValue ( container ; 1 ) ; ":" ; "¶" ) ; 2 )
If the path is different, I don't know. It may depend on how the image/file is stored for you.
The text functions in FileMaker, such as GetValue & Substitute I used above are wonderful at parsing. I use Position(), Middle(), PatternCount() and the other text functions to parse all the time!
when you use getastext(containerfield) it tells you in the string the name of the file... which you would have to parse out. I would make sure it then gets entered into a field.
Thank you Lyndsay. I had extracted the text info from the container but the main problem I have is filtering the name out of all the other info. Have you got a clever script to do this?
The other problem is what to do in Windows to open the file in the container?
Thank you for your help
Thank you Beverly. It works like magic!
Retrieving data ...