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 Continue reading “Cocoa Tricks: How to send a keystroke event to the process with AppleScript”