Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5490 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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 [ ]

Posted

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).

Posted

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.

This topic is 5490 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.