You are correct. attachment need to be a file.
Some plug-ins can attach container field, but standard script not.
So if I just set my variable = get(temporypath) & "mypdfname", it should work?
If you are running the script using FileMaker Pro or Go, then you can set a variable such as $path to a file path in the local temp folder, and then use 'Export field contents...' to export the container field to that path, and then use the same $path variable in your send email script.... Note that 'Export field contents' is not supported if the script is run on Server.
The script might look something like:
Set Variable [ $path; Value:Get ( TemporaryPath ) & GetContainerAttribute ( my_container ; "filename" ) ]
Export Field Contents [ my_container; “$path” ]
Send Mail [ Send via E-mail Client; To: "email@example.com"; Subject: "my subject"; Message: "my message"; Attachment: “$path” ]
Ok that did it thanks for the pointers!
I will be sending from the server, however thanks as this is useful to know