Here are example OnSetText scripts that would flip the names around if it finds a comma in the name.
This is designed as two separate scripts to populate a firstname text object and a last name text object. If you want it all in one text box you'll need to combine the scripts and concatenate the results together.
First name OnSetText:
`dim list(3) as string
'Check for a comma
if( InStr(text,",") > 0) then
list = split(text,",",2)
text = ltrim(list(1))
else
list = split(text," ",2)
text = ltrim(list(0))
end if
`
LastName OnSetText:
`dim list(3) as string
'Check for a comma
if( InStr(text,",") > 0) then
list = split(text,",",2)
text = ltrim(list(0))
else
list = split(text," ",2)
text = ltrim(list(1))
end if
`
#XPression