November 10, 200916 yr According to FM Training Series "if you specify a file path/name for output (either explicitly or by a variable reference) and do not select a field to export, that file, if it exists, will be deleted from the user’s workstation" Does anyone know why the DeleteFile script in the attached sample file does not work? The file path comes directly from the original import file path. TestDelete.zip
November 10, 200916 yr Try this one: Set Error Capture [ On ] Set Variable [ $filePath ; [color:red]Value: GetAsText ( testfiledelete::Image_cr ) ] Export Field Contents [ $filePath ] [color:red]Refresh Window [ ]
November 10, 200916 yr The FMP 9 Script Steps Reference document says that "if no field is specified, FileMaker Pro will export the contents of the current field in the active table". It says nothing about deleting files, and I kind-of doubt it would be designed to do that (could be wrong though).
November 12, 200916 yr Author It does work, although not likely designed that way. raybaudi's example (thank you) works great for image files, but failed for pdfs. This works for both. $fileName = Substitute( testfiledelete::OriginalPath_lxt; "file:/"; "file:") The result of the field containing original file path has two "/", only one works when trying to delete a file. I don't know why... If anyone has more info on this I would like to here it. Thanks for your replies.
Create an account or sign in to comment