Automatically select and copy a translation from IATE (Tampermonkey script)


  • Administrator
  • Hero Member
  • *****
    • Posts: 849616
    • Gender:Male
  • point d’amour
You use IATE often and you find it hard to select/copy a translation? Translatum has a feature whereby from search results you can simply click an icon to copy the desired text (Click to copy in search results). Something similar can be applied to IATE by using the browser extension Tampermonkey.

Once you install and activate the extension, create a new script and add the following content. Once this is done, and the script is enabled, you can simply click on a term translation in IATE and it will be automatically selected and copied. Now you can paste it anywhere you want by pressing CTRL+V.

Code: [Select]
// ==UserScript==
// @name         Iate select and copy
// @version      0.1
// @author
// @description  Select and copy IATE translation by clicking on it - more here:
// @match*
// @require
// @grant        GM_setClipboard
// @grant        GM_addStyle
// ==/UserScript==
/* globals waitForKeyElements */

(function() {
    'use strict';

    GM_addStyle('app-iate-search-term-refine { user-select: all !important; }');

    waitForKeyElements('app-iate-search-term-refine', addListener, false);

    function addListener() {
        const elements = document.querySelectorAll('app-iate-search-term-refine');

        elements.forEach(element => {
            element.addEventListener('click', () => {
                const text = element.textContent.trim();


« Last Edit: 24 Dec, 2022, 10:18:12 by spiros »


Search Tools