June 2, 200916 yr hi -- i'm trying to write a script to email an attachment of a file that I stored with Supercontainer. if the table related to the document I have stored is called Document, here is my script: Set Variable [ $result; Value:SCDownload("Document/" & DOC:_pk_DocumentID ; Get (DesktopPath)) ] The I use the Send Mail via SMTP Server step and I write this in the Attachment section: Attachment: “file:$result” Any ideas on what I doing wrong?
June 3, 200916 yr the file name is prob not the same as the path to the file in SC once the file is saved to the desktop you should give the file name. and use that name in connection with the desktop path. for your attachment. Remember SC saves files in a folder that matches your pk_DocumentID and the real file xyz.jpg is inside that folder - when it saves to the desktop you need to target the real file. I've just used native export field contents if the field is a calculated container field using the SC Plugin.
June 3, 200916 yr Author Interesting. I thought SCDownload function put it in a temporary location on User's computer and then you could just send it with that name. How do I change its name?
June 3, 200916 yr Here is a script example that will do this for you. Set Variable [$baseurl; Value:SCSetBaseURL("http://yourhostIP/yourdirectory")] Set Variable [$filepath; Value:"your/local/download/directory" & "yourdownloadedfile.name"] Set Variable [$calldownload; Value: SCDownload(SC_test::kf_yourkeyfield; "your/local/download/directory")] Send Mail [send via SMTP Server; No dialog; To: "[email protected]"; Subject "email subject"; Message: "test email message body"; "$filepath"] If you do not specify a download directory FileMaker will save the file in your system's temporary folder.
Create an account or sign in to comment