AppleScript to rename Safari Tab

applescriptsafari

There is an option in Keyboard Maestro to rename any tab on safari with the name you want

I'm trying to do the same using AppleScript but is this even possible?

I have nothing so far, I'm guessing JavaScript would be the way to do it

tell application "Safari"
    tell front window to make new tab at after first tab with properties {URL:myLink}
    -- need to rename tab here
    tell front window to make new tab at after second tab with properties {URL:myLink}
    -- need to rename tab here
    tell front window to make new tab at after third tab with properties {URL:myLink}
    -- need to rename tab here
end tell

Best Answer

Found the solution using JavaScript:

tell application "Safari"
    do JavaScript "document.title = 'Hello!';" in tab 1 of window 1
end tell