This code shows how to send a keystroke event for instance Control-Command-1 and Control-Command-0 to Finder with AppleScript. This is equivalent to pressing Finder->View->Arrange By->Name and Finder->View->Arrange By->None

That’s it!