User:Orange Suede Sofa/Archiving with AppleScript

Has this ever happened to you?
You tried to verify a reference, but the URL was dead. You went to the Wayback Machine and found a URL, but are too pressed for time to update the citation template to include the archived URL. And finally, you edit Wikipedia with macOS.

How this works

 * 1) Find your archived URL and copy it to your clipboard. This script only works with Wayback Machine URLs. If you don't have an archive URL ready, then learn more at WP:LINKROT.
 * 2) Edit your page and find the citation that needs to be updated.
 * 3) Place your insertion cursor before the last   in the citation.
 * 4) Run the script in the manner of your choosing (I use Automator, which will need to have Accessibility permissions turned on in Settings&rarr;Privacy & Security).

The script will insert  with the URL from the clipboard and parse the URL to insert the   parameter. The script does not add, as this is implied if   is present.