If you use the 'Insert file' script step and store it in a container as a file reference, then you can get the file path… See attached which uses a simple calculation to display file path details.
Note, you could have your container positioned outside of the visible part of your layout...
Hope this helps,
getpath.fmp12.zip 65.0 K
That's the native way! You can delete the container's content after reading the path
If you are using the container strictly for the purpose getting the file path, I would add the suggestion to set the storage to global. I would also clear it after getting the info you want as suggested by Markus.
GetContainerAttribute ( file; "externalfiles") produces a nicer path, one that isn't broke with /.../... etc. I haven't tested this and the help file sounds like more than one file might get picked up.
GetContainerAttribute ( file; "externalfiles") produces a nicer path, one that isn't broke with /.../... etc.
So, what sort of path does GCA ( field ; "externalFiles" ) return …?
On windows it delivers the full pathname with window style separators:
Pointing to the container field in a calculation produces:
[This is one reason to use a larger text field to see the results of various calcs as more info is returned than is visible on one line.]
Changing the calulation to getvallue( containerfield ; 2 )
so you have two full paths, one windows style and one FileMaker style.
Going one step further making the caluclation:
GetContainerAttribute ( containerfield ; "externalfiles") & PP &
getvallue( containerfield ; 2 )
giving both the windows and filemaker paths.
...and or other modifications to suit ones taste.
Disclaimer: I may have typoed the changes I made in the pathnames...
A warning about GetContainerAttribute ( file; "externalfiles")...
This isn't documented the new features guide, but the behaviour of this function is different in 14 than in 13, at least on a Mac.
14 returns /Volumes/[volumename]/[foldername]/... while 13 returns simply /[foldername]/...
That's ok, one-line calculations are no fun anyway...