Automator workflow / app to refresh a given tab in Safari (or even Crome) When I am coding my Rails app I am switching back to Safari quite often to refresh my local version of the site to see if my changes are correct.  It would be awesome to just hit one of the function keys and that would bring my Safari window to the foreground and manually refresh the page.

I can't seem to find an obvious example of this or anything along these lines fro the typical Google searches etc.

Any idea if this can be done and if so how (at least the Automator part)?
Paste this script into script editor and save it as a service. Map the service to a keyboard shortcut.

tell application "Safari"
    activate
    tell current tab of window 1
        do JavaScript "location.reload();"
    end tell
end tell


EDIT 

tell application "Safari"
    activate
    tell window 1

        --options
        set myTab to tab 1
        set myTab to first tab whose URL = "https://apple.stackexchange.com/questions/224393/automator-workflow-app-to-refresh-a-given-tab-in-safari-or-even-crome/224431?noredirect=1#comment272178_224431"
        set myTab to first tab whose URL starts with "https://apple.stackexchange.com"

        if current tab is not myTab then set current tab to myTab
        tell myTab to do JavaScript "location.reload();"
    end tell
end tell


EDIT 2
Select your tab and run this script to get its name

tell application "Safari"
    activate
    tell window 1
        get name of current tab
    end tell
end tell


Populate the name in this script:

tell application "Safari"
    activate
    tell window 1
        set myTab to first tab whose name = "insert name here"
        if current tab is not myTab then set current tab to myTab
        tell myTab to do JavaScript "location.reload();"
    end tell
end tell