Need help with ( Save a Material(s) Preset Script )

The Save a Material(s) Preset script running in Silent mode isn't saving the same as it does with the same user input information.
With run silent set to true I get this.
I change the run silent to false.
I use the same options that run silent would use in the options and I get this witch is what I want.
So the question is how do I get it to run silent and save the file out like it does with user input?
Comments
The formatting of the commands is explained in the comments:
so you need to use
to get both values and maps
Thanks, Richard after going back and reading the comment again now I see where I went wrong at that time I was reading the comment I was tired and misread it.
Thanks again.