May 17, 201114 yr I assume this isn't possible without a custom plug-in, but... I have a table which stores images (and other data files) in a container with fields for various indexing and flagging. Occasionally the user wants to facility to export all the images stored to a folder on their PC. When exporting one embedded file, I use a simple script with the "Export Field Contents", then the user specifies the target field. All nice and easy. But the batch export, I'm stumped... If I set a loop to run through multiple for export, obviously the user doesn't want to select the destination for every file, but instead just once. Could I export one (displaying the target file destination dialog), and somehow return the path the user chose and then specify that path in the loop for the rest? I can't see how to capture the path chosen, or find another way of allowing a user to select a destination first and capture it to a variable. I can return the path the system is running from, the desktop and My Docs, but none of those are any direct use as I want a user specified folder. Also as an aside, can I get the system to create a sub-folder for the save/export function? There seems to be no OS file/folder manipulation at all. (This is on FileMaker 11 Advanced, and will end up as a runtime, and I doubt there'll be further budgets for plug-ins...).
May 17, 201114 yr Best practice is to avoid storing files in container fields, but rather use references. You are right, there is no straightforward way to have a user select a path (specifically a directory/folder) and then use that path to export the field contents. I believe 360works Scriptmaster (which is free) might be of some help. Troi is the typical go to for file/folder manipulation plugins. However, rethink storing (embedding) files in containers. It'll bloat the file tremendously, making backup quite slow.
May 18, 201114 yr Author Thanks bcooney, I agree with not embedding files, but it's a separate fp7 file storing the images they want to embed so they can just move one single file, as this will be distributed via runtime, so the user wouldn't have the files in the correct area in many cases. Annoying there is no generic file manipulation to capture a path, just need a generic windows dialog with variables to capture what is happening Thanks for the plug-in recommendations, I'll have a look, but it's unlikely there is any more cash in the pot for this project if a runtime licence is needed, not sure the freebie Scriptmaster can do exactly what's needed, but will review.
May 18, 201114 yr "... I agree with not embedding files, but it's a separate fp7 file storing the images they want to embed so they can just move one single file, as this will be distributed via runtime, so the user wouldn't have the files in the correct area in many cases." You could have them upload the file into a global container field (Use Insert File), and then Export File to a specific directory (perhaps a sub-directory of Get (FileMakerPath)?), storing the path in the table, and clearing the global container. If you're shipping a runtime, use an installer to place the directory of files where you need it to be.
May 24, 201114 yr I assume this isn't possible without a custom plug-in, but... I have a table which stores images (and other data files) in a container with fields for various indexing and flagging. Occasionally the user wants to facility to export all the images stored to a folder on their PC. .......................... Also as an aside, can I get the system to create a sub-folder for the save/export function? There seems to be no OS file/folder manipulation at all. (This is on FileMaker 11 Advanced, and will end up as a runtime, and I doubt there'll be further budgets for plug-ins...). Not the best idea yet but you could always use a dialog box (with table::field_path to force them to type out the location for export and then use that field for subsequent exports. But interesting problem and I'm looking further for something ........
May 25, 201114 yr I assume this isn't possible without a custom plug-in, but... But the batch export, I'm stumped... OK ... this may be totally stupid to those of you who are actual programmers... but... here's what I have so far. Fields or variables: _container _containerpath1 is a Calc; GetAsText ( ___container ) #My problem here is 'm terrible at calc.'s and path2 needs an added part to remove the file name from the end.... _containerpath2 is a Calc; GetValue ( ___container path ; 2 ) which returns an exportable path but has the file name also Script: Set Error Capture [On] # Whatever the original export is Export Field Contents [file] # Message to verify the remaining exports to this folder or something Show Custom Dialog [Export remaining files here?] # Only problem is they next HAVE to select a file... poss. the last one exported? Insert File [Reference; table::_container] # Make sure to check 'Store only a Reference' box Set Variable (Like- $export_path) or Field [table::_containerpath2] Loop # Export the rest End Loop Also as an aside, can I get the system to create a sub-folder for the save/export function? There seems to be no OS file/folder manipulation at all. (This is on FileMaker 11 Advanced, and will end up as a runtime, and I doubt there'll be further budgets for plug-ins...). Can they not use the 'create Folder' icon in the 'Export Field to File' window? So feel free to rip me .... but hey... I tried.
Create an account or sign in to comment