We don't really think of a script as "autofill", but it sounds like you just want to know how to set a field to a combination of values within a script. One thing you did not mention was what table (table occurrence, TO for short) you want to do this through. In a simple database this would be the one which is attached to the layout (in a flat 1 table file, there is only 1, so not to worry). I'll just put "TO" where it would be.
Set Variable [ $id; 1 ]
Set Field [ TO::nameid; TO::name & $id ]
The & (ampersand) is the text concatenation operator. Now, whether you "should" do this is another question.
Set Field [YourTable::NameID ; YourTable::Name & $ID]
Thanks for the fast reply.
That was exaclty what i needed.