I need to find out what I am doing wrong in my script. I have a script that I have scheduled on the FM server to run every morning. The script does a find, save to Excel, attach the excel to an email, and send the email. When I run the script normally everything works fine, but when the server runs the script it does not attach the excel.
Sort Records [ Restore ; With dialog: Off ]
Set Variable [ $excel ; Value: Get ( TemporaryPath ) & "Creditors invoiced before File opened on " & Substitute ( Get ( CurrentDate ) ; "/" ; "-" ) & ".xlsx" ]
Save Records as Excel [ Restore ; With dialog: Off ; “$excel” ; Records being browsed ]
Pause/Resume Script [ Duration (seconds): 20 ]
Send Mail [ Send via SMTP Server ; No dialog ; To: "email@example.com" ; CC: "firstname.lastname@example.org" ; Subject: "Creditors invoiced before File Opened on " & Substitute ( Get ( CurrentDate ) ; "/" ; "-" ) ; Message: "Hi Admin," & ¶ & ¶ & "Please find attached the excel report of any creditor invoices that have been captured, but the file was opened after." & ¶ & ¶ & "Regards,” ; “$excel” ]
What am I doing wrong? I even saw something about adding a pause in before the send mail, but that still is not working.