Troubleshooting "Unexpected argument" error when running defaults write Trying to change the default screenshot directory to a specific folder in my google drive, but when I try the following command

defaults write com.apple.screencapture location ‘~/Users/tommy\Google Drive\Sync\iMac\iMac Screenshots’


I get this error

2014-11-10 21:49:43.644 defaults[2184:76708] Unexpected argument DriveSynciMaciMac; leaving defaults unchanged.


and I don't know what I'm doing wrong.
There are backs lashes (\) in your path that should probably be forward slashes (/). You also use curly quotes (‘ and ’), which are weird at best. Try using straight quotes ('), although in that case straight double quotes (") should do as well:

defaults write com.apple.screencapture location '/Users/tommy/Google Drive/Sync/iMac/iMac Screenshots'