0

Very new to applescripts and any code outside of VBA in general.

I am running the code below to debug an issue in a larger code block.

If I run the do shell script by pasting the line into Terminal, I will get a numerical value on my clipboard based on where my mouse cursor is on the screen.

If I try to run the code itself, the yCoordinate is always blank - so there must be some issue with the Shell Script running or with setting the variable to the clipboard itself.

Please help!

-- script test me

-- delay variables
set delayOne to 0.2
set PageDelay to 2

-- start coding below

do shell script "eval $(/usr/libexec/path_helper -s);  cliclick p:. | cut -d ',' -f2 |  tr -d \"\\n\" | pbcopy"
set yCoordinate to the clipboard
delay delayOne

display dialog "" & yCoordinate





Striccara
  • 1
  • 1

1 Answers1

0

This ended up being a problem with the path for Cliclick. Homebrew on M1 installs in a different directory. This code works if you replace the path with the following.

do shell script "eval /opt/homebrew/bin/cliclick p:. | cut -d ',' -f2 |  tr -d \"\\n\" | pbcopy"
Striccara
  • 1
  • 1