Convert bitmaps+masks to Arnold materials (script modification)

This script works but with standard materials.
Assuming that I select same png files for diffuse and masks,
can I create an Arnold Standard Surface material from that?

I need this to be modified in these:

-Replace Standard material with Arnold Standard Surface material.
-Assign all png and their copies as "Base Color" and "Opacity"
to this Arnold Standard Surface material
-Especially to the png assigned to "Opacity" enable the:
Bitmap parameters->RGB Channel Ouput->Alpha as grey

Really big thanks.
Cheers.
Petros.

(
function getImages = ()
local DiffuseArr = #()
local MaskArr = #()
local MaterialArr = #()

rollout rollMaterials "Make Materials"
(
button btnDiffuse "get diffuse" width:150
button btnOpacity "get masks" width:150
button btnCreateMaterial "create materials in editor" width:150 tooltip:"create the materials in the editor, max 24"
on btnDiffuse pressed do
(
DiffuseArr = getImages()
btnDiffuse.text = "diffuse (" + DiffuseArr.count as string + ")"
)
on btnOpacity pressed do
(
MaskArr = getImages()
btnOpacity.text ="masks (" + MaskArr.count as string + ")"
)
on btnCreateMaterial pressed do
(

for i=1 to DiffuseArr.count do
(
mat = standard diffuseMap:(Bitmaptexture fileName:DiffuseArr[i]) name:(getFilenameFile DiffuseArr[i])
if MaskArr[i] != undefined do mat.opacityMap = (Bitmaptexture fileName:MaskArr[i])
if i < 25 do meditMaterials[i] = mat
)
)
on btnCreateLibrary pressed do
(
for i=1 to DiffuseArr.count do
(
lib = materialLibrary()
mat = standard diffuseMap:(Bitmaptexture fileName:DiffuseArr[i]) name:(getFilenameFile DiffuseArr[i])
if MaskArr[i] != undefined do mat.opacityMap = (Bitmaptexture fileName:MaskArr[i])
append lib mat
)
fileSaveAsMatLib()
)
)
createDialog rollMaterials style:#(#style_toolwindow,#style_sysmenu)
function getImages =
(
theDialog = dotNetObject "System.Windows.Forms.OpenFileDialog" --create a OpenFileDialog
theDialog.title = "Select Diffuse" --set the title
theDialog.Multiselect = true --allow multiple files to be selected
theDialog.Filter = "JPG (*.jpg)|*.jpg|All Files (*.*)|*.*" --specify the filter
theDialog.FilterIndex = 1 --set the filter drop-down list to All Files
result = theDialog.showDialog() --display the dialog, get result into variable
result.ToString() --when closed, convert the result to string
result.Equals result.OK --returns TRUE if OK was pressed, FALSE otherwise
result.Equals result.Cancel --returns TRUE if Cancel was pressed, FALSE otherwise
return theDialog.fileNames --the selected filenames will be returned as an array
)
)