Hello, i want to duplicate the active tab in safari with help of an applescript.
If i start the script in the scripteditor all works fine but if i start it in safari, a new tab appears and the old tab reloads.
tell application "Safari"
activate
set this_URL to URL of document 1
my create_tab(this_URL)
end tell
on create_tab(new_url)
tell application "System Events"
tell process "Safari"
keystroke "t" using command down
end tell
end tell
delay 0.2
tell application "Safari"
set URL of document to new_url
end tell
end create_tab
Please Help