Error: Can't Open Display: (Null) Failed Creating New Xdo Instance on Mac Os
I Looked at Many Answers on Internet but No Solutions Helped. When I Just Do Open It Works, My Default Browser Is Google Chrome. I Downloaded Xdotool Package...
I looked at many answers on internet but no solutions helped.
When I just do open it works, my default browser is Google Chrome. I downloaded xdotool package via brew
What I want to do is, to open the webpage(any webpage) and refresh it in every 10 seconds, I have the following code:
#!/bin/bash
while true;
do
export DISPLAY=:0.0
export XAUTHORITY=/home/dogaister/.Xauthority
open
xdotool key command+r
sleep 10
done
I also tried DISPLAY=':0' or DISPLAY=':0.0', they didn't work either.
1 Answer
#!/bin/bash
while true;
do
osascript -e 'tell application "Google Chrome" to reload (tabs of window 1 whose URL contains "google.ca")'
sleep 10
echo "Reloaded"
done
worked. Thanks to Mark Setchell for his contribution