May 11, 20205 yr Hi everyone, I'm trying to get attaching files go mails generated using FM17 to work. The idea is to attach a variable file to a mail-message generated for a specific record. The filename for the attachment is specific to the record and I've got a field that generates that filename (fileNamejpg01). I'm using the send mail option in a script (which is working) and the option to attach a file by giving a file path. That file path looks like this: file:../../../Desktop/werkmap/Beeldmateriaal/instagram/$fileNamejpg01 The variable part is "$fileNamejpg01" and I'm sure I'm doing something really dumb ... but don't find anything that solves the problem (or that I at least understand). Hope someone can help! Thanks, Peter
May 11, 20205 yr The file path window and what you feed it is not a calculation window so you have to calc the path ahead of time and feed it the resulting variable Set Variable[ $path ; Get(DesktopPath) & "werkmap/Beeldmateriaal/instagram/" & $fileNamejpg01 ]
May 12, 20205 yr Author 18 hours ago, Wim Decorte said: The file path window and what you feed it is not a calculation window so you have to calc the path ahead of time and feed it the resulting variable Set Variable[ $path ; Get(DesktopPath) & "werkmap/Beeldmateriaal/instagram/" & $fileNamejpg01 ] I'm staring blindly at a screen now after trying again ... I'll give it a rest until tomorrow and I'll let you know if I've gotten it to work Wim!
May 13, 20205 yr Author I'm lost ... I've added two screenshots of what I have now but I can't get it to work. Been trying different options of all I could think of but not getting anywhere. Hope you can make sense of it Wim. It's probably something really dumb I've done but it would help a lot if I get to understand it and get it to work! Thanks!
May 13, 20205 yr No, that last window is not a calculation dialog. The only thing you should have there is: $path The $path variable needs to be set in your script before you get to the Send Mail script step
May 14, 20205 yr Author Thanks for you patience Wim! I got it to work and cleaned up my folder structure a bit to make the whole think a bit more clean and simpel while I was at it. It makes the path-calculation a lot easier. For future reference if people are looking for a similar solution I've included the screenshots of my results: 1. The window that will send the mail 2. The window that calculates the path to the image file 3. The entire script to get it working! Thanks!
May 14, 20205 yr On 5/11/2020 at 7:08 PM, Wim Decorte said: The file path window and what you feed it is not a calculation window True, but it's worth noting that it is possible to enter a path as a mixture of literal text and variables. For example, after setting these variables: Set Variable[ $workFolder ; Get(DesktopPath) & "werkmap" ] Set Variable[ $filename ; YourTable::SomeField & ".jpg" you could enter: file:$workFolder/Beeldmateriaal/instagram/$filename as a valid path into the Specify File window.
Create an account or sign in to comment