Here is a better and simpler method using Automator. You don't need an AppleScript.
The key to triggering the automatic copy action is to use red_menace's technique:
"Open Automator, choose the Folder Action template, and select Other... in the workflow popup menu to get a dialog to choose the folder to attach it to. You won't see the /Volumes folder in the dialog, since it is invisible and all, but you just jumped through that hoop, so it will be under Recent Places in the toolbar's path popup menu."
Do that, and the rest flows from there.
Basic instructions are as follows:
- In the the Finder's Go menu > Go to Folder... type /Volumes then Go. Leave that window open.
- Decide upon the folder that will contain all the items you wish to automatically copy to the external hard disk whenever you connect it. For this example I named it "copy these".
- In Automator, choose "Folder Action". At the top, choose Folder Action receives files and folders added to and choose Other... from the dropdown menu. Drag the hard disk icon from /Volumes into its dialog box.
- Then, using Library > Files and Folders, add Get Specified Finder Items, followed by Copy Finder Items. In its dropdown menu adjacent to To: choose the destination on the external drive. You will probably want to check the box for Replacing existing files since they are intended to be backups.
- Save the Automator Folder Action.
Then, whenever you connect the external hard disk drive, all the items in "copy these" will be copied to it.