Insert File/Picture/PDF/etc. Script Step with Interactive Content
In a solution I am working on I am trying to insert a number of files a user has been working with in a global field into interactive container fields in records. The file that is active is stored as a reference in a Global Container field, and additional files are kept as paths in a value list. All of this works as expected. The trouble comes when I am scripting the saving of the files to records.
I have tried it two ways now. The first by using the Insert File script step. I don't want to show the user the file selection dialog again to have them select the same files that they have already been working with. This means I cannot use 'Dialog options' to 'display content when possible,' and the script step inserts the file as an 'Icon with filename' by default.
I have also tried to use the Insert Picture/PDF/Etc. script steps by comparing the file type to value lists containing the appropriate file types for the appropriate script step (.png will use Insert Picture while .pdf will use Insert PDF). This throws an error that the file cannot be found even though when I step through the script to examine the path that is being passed it is the same as the one that I would have passed to the Insert File Script Step that inserts the File just fine (albeit not in an interactive format).
The attached image shows the script using the second method I describe, the Insert File script step as in the first method, and two paths in a value list as described above.
Any insight? I can provide more detail and examples if this is not clear.