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

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

Recommended Posts

Posted

Here is the context of my issue. I have a script that saves a .pdf file to the desktop, attaches that file to an email, and then sends the email via the user's email client (Outlook, Thunderbird, etc). Immediatly after the Send Email script step I use a Send Event step to delete the .pdf file that was just created from the desktop. The event calculation is as follows:

"cmd c/ del " & Quote ( $File )

The $File variable is created eariler in the script and contains the location of the .pdf file to be deleted formated as "C:\[path]\[file name]". I use the Quote() function because parts of the file path contain spaces.

When the Send Event script step executes a command line window opens with the following text:

"C:\Program Files (86)\Mozilla Thunderbird>" (and a blinking cursor)

The command itself never gets sent. The same happens with a user using Outlook with the resulting text saying "...\Outlook>" instead of "...\Mozilla Thunderbird>" If I then paste in the command manually (del "C:\[path]\[file name]") it works, and the file gets deleted. Something about the Send Event script step being executed in the context of the client email software blocks the command. How do I get around this?

Posted

Well, if you could see me right now, my face would be taking up residence in my palm.

I put the "c" and "/" in the wrong order. Should be "cmd /c" NOT "cmd c/".

Problem fixed.

Posted

You will find that computers used in corporate environments often lock (write protect) the desktop and other folders, in which case your process will fail because the pdf will not be saved.

Save the pdf to the temporary folder instead and forget about trying to delete the file. It will be automagically cleaned up at the end of each FMP session, the folder always has write privileges, and the it is hidden away from prying eyes.

This topic is 4686 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.