cliclick
cliclick copied to clipboard
Feed command a variable?
I am wondering if it is possible to give the "c: ...." command a variable instead of a number. I would like to set the value of the variable to be a number based on the current resolution of the screen, since my computer is used in different scenarios with different monitors.
The command you pass to cliclick is a string. By inserting a variable into that string, you can effectively use a variable. How to do that depends on the programming language used. For instance, in a Bash script, code such as this could be used:
width=$(system_profiler SPDisplaysDataType | fgrep Resolution | awk '{print $2}')
cliclick m:$width,200