I'm not sure I understand.
In your example, you named the attachment "contracter.PDF". As I understand your question, you would simply use different text in place of that in your first script step to change the name of the attached file. And there's no container field in the above script, only a variable.
I was wanting to have the option to name the PDF what ever I wanted. Is there way to do that in the script. Maybe have a field in the layout for naming and direct the script to use that, or maybe a window can pop up during the script and ask me to name the PDF?
As for not having a containter, I thought it strange as well that I didn't designate a container field, but it works. I thoughout I was sappose to do it that way? I was thinking it worked because I used the save records as "current record". There is only two fields in this layout the container and a comments field and I set thie comments field not to print and I thought maybe that is why the pdf knew which feild to show, because the pdf image turns out right.
A container with store a reference can be one way to get to the file name and path of an existing file. It does not appear to be needed in this solution.
Take a look at the first script step:
Set Variable [$FilePath ; Value: Get ( TemporaryPath ) & "Contractor.PDF" ]
It names each PDF file "Contractor.PDF". If you change that expression, you can name the file anything you want as long as you specify the .PDF file extension.
Set Variable [$FilePath ; Value: Get ( TemporaryPath ) & YourTable::YourField & ".PDF" ]
Set Variable [$FilePath ; Value: Get ( TemporaryPath ) & $$FileName & ".PDF" ]
Are both workable options that allow the file name to come from somewhere external to the script--such as text entered into a text field.
It works great.