Look at almost any other script and you'll find examples of using the Command object. e.g. Button: Merge Folders