Scripted SFTP command line file transfer Mac OS X
I guess i need to generate a key from the server itself and provide it to the user then they can connect just using the username and the key will authenticate them right? 


No. Generate the key on client (ssh-keygen) and upload the public key to server. For example using ssh-copy-id, if the ssh is allowed on the server. There are many how-to's around the internet, so I believe you will be able to figure out.

Then connecting would work like sftp username@host (without password). If you have some batch, you can provide it to sftp using -b option. For more info, consult manual pages for sftp or the other above mentioned tools.