AppleScript Programming/Advanced Code List/tell
To use the tell command to send an application a message using AppleScript, use the following as an example:
tell application "Finder"
empty the trash
end tell
the first line is which application you are giving the command to the second line is the command and the third line closes it up for more information click file and open dictionary in the applescript editor in the utilities folder