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 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.

6

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like