your script is not working
Your comment is not helping.
Jokes aside. Helps if you tell me how it isn't working or what is going wrong.
You might need a delay between creating the file and changing the content.
# Create a file with specific content.
{
# Variables.
:local filename "test.txt"
:local content "This is a test."
# Create file.
/file print file=$filename where name=""
# Wait for the file to be created.
:delay 1
# Set file's content.
/file set $filename contents=$content
}
Works for me, but there are times when this will stop working and if it takes too long to create the file it won't be able to write.