Rainy Pass Posted November 10, 2009 Posted November 10, 2009 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
Raybaudi Posted November 10, 2009 Posted November 10, 2009 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 [ ]
Vaughan Posted November 10, 2009 Posted November 10, 2009 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).
Rainy Pass Posted November 12, 2009 Author Posted November 12, 2009 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.
Recommended Posts
This topic is 5840 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now