Because of this location, in my AppleScript code and in Terminal app, I need to use the full path to cliclick to call the command. cliclick in the following directory: /usr/local/bin/. It's free to download but it's donationware, and is easy to install. Moreover, it lets you move the mouse, get the current mouse coordinates, press modifier keys etc. It is a a tiny shell/Terminal application that will emulate mouse clicks or series of mouse clicks (including doubleclicks and control-clicks) at arbitrary screen coordinates.
“Cliclick” is short for “ Command- Line Interface Click”. This code requires the third-party utility, Cliclick.