Jump to content

MainForm.Script


picyka

Recommended Posts

I have some functions in a js file included in CustomFiles,

it works perfectly.

I would like to put these functions in MainForm.Script but there I had no result.

 

async function copyText(texto) {
    try {
        await navigator.clipboard.writeText(texto);
    } catch (err) {
        console.error('Failed to copy: ', err);
    }
};

async function pasteText(jsName) {
    navigator.clipboard.readText().then(texto => {
        let cmd = jsName + ".setValue('" + texto + "');";
        eval(cmd);
    });
};

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...