Without investigating this too much myself, wouldn’t another option be to just tell the webpage to refresh itself?
tell application "Safari"
tell front document to do JavaScript "window.location.reload()"
end tell
This would remove the need to have browser-sync running.
If browser-sync was better, you could also adapt @PeteSharp ‘s idea as follows…
Instead of adding the Run AppleScript action, there is also a Run Shell Script action. Then you could insert just the browser-sync start --proxy '``http://YOU-PROXY-IP``' bit in there.
Hi @reflex, sure you can run a script to reload the page every time you want to reload it (but why? when you can cmd+r)… but this tip is about Browser Sync, where it automatically reloads on file change and works across a local network. Great workflow (well for me anyway).
My approach to the shortcut, creates a terminal window specifically just for Browser Sync to run in, handy if you have an existing terminal open.
Ohhhh. Now I’m understanding. I thought your script was to tell browser-sync to do an update. Which I didn’t understand (since it’s supposed to do as you just said). I don’t use it myself.
So now I see that you were creating a script to launch the process, not refresh it.