How you get that list of files in the first place is an interesting challenge. It would likely require a file manipulation plug in or importing the results of a system script that listed file paths.
But once you have that list, you can assign the file path to a variable and use that $Path variable with the Insert File script step to insert either a copy of the file or a reference to it.
See this thread for more on $Path variables: Exploring the use of a $Path Variable in Scripts
Just running a test that makes a variable of one path, I can't seem to get the path sent. I keep getting a message that the file can not be found but I see it is ignoring the directory.
G:\My backups\Shane Last\shane010309.tib
I am trying to escape it like so
G:\\My backups\\Shane Last\\shane010309.tib
Should I be able to pass a directory as a variable?
I see what you mean about getting the list. My lists, I will already have. I want to paste them to a global field and let a loop grab each and make it into a variable. Am I thinking about this the wrong way.
If this is the text in a single field:
C:\Apache24\INSTALL.txt C:\Apache24\LICENSE.txt C:\Users\Public\Documents\Autodesk\AutoCAD 2014\R19.1\PTXML\AdskHwCertificationDatabase.xml G:\Mybackups\ShaneLast\shane010309.tib
Set Variable [$Path ; Value: GetValue ( YourTable::YourFIeldofFileNames ; 1 ) ]
to the $Path variable.
With a loop that increments $K by 1 each time, you could use:
Set Variable [$Path ; Value: GetValue ( YourTable::YourFIeldofFileNames ; $K ) ]
Inside that loop to parse out one file path at a time.
If this works for some directory letters and not others, I would first make sure that the directory is mapped to the correct letter on your current computer and then analyze the file path to see why the file path is not valid.
Its funny even for the C: drive I receive this error. I am trying to investigate why now. Should be C:\Apache24\INSTALL.txt
What happended to the "C:" that should be at the beginning of the file path shown in the error dialog?
Before the script ended I checked the value of $Path with the Data Viewer it was C:\Apache24\INSTALL.txt and some how FileMaker removed it?
When you checked it in the data viewer, you could see the correct complete file path with the drive letter?
Since you have FileMaker Advanced, have you tried using the script debugger to step through your script to see if that provides any useful clues?
Yes I see it C:\Apache24\INSTALL.txt and FileMaker is removing the C: for some reason. This is what made me even start the thread. I thought this was normal (for FileMaker) and I was not doing something correct. I will further test to see if I can determine why.
this is my script, just testing one.
Just to be sure it does not have to be named $Path, correct?
And Does GLOBAL::xlist contain multiple file paths as shown in your original post?
Weirdly enough when I tried $Path I get this now.
No I was just testing it with one, before that did not work. I can set it up that way but the loop was making it more complicated to test.