How do you name PDFs? You are using TOOL_NO for both $folder and $PDFName.
Yes. The folder and the file has same name. That how it was filed initially.
you logic is a bit flawed
Set a variable $PDFfile
then say if the last error was 0 do a step
which is ALWAYS going to be the case (even if the component parts of $drive $folder $PDFname ar empty)
you will NEVER get to the step which tries to open the PDF
the Get ( LastError ) stores the error for the LAST action that FMP does than returns an error code
In this case the Set Variable step
You have not done anything to test if the file IS there which would throw an Error 100 - like trying to import it, or using some plugin to see if the file exists (like Base Elements)
And the Send event step will not be doing that for you either.
Thank all of you for your replies. I found a different way to accomplish my task and it works perfectly.