paste

paste($text=""); - paste text from the clipboard. (since version 7.0.2, the $text parameter has been added : if the $text parameter is set, the text from this parameter is copied to the clipboard first)

After testing, the function returns the result of its work to the script :
  • true – completed successfully
  • false – failed

    PHP example: browser->".basename(__FILE__)."
    "; //1 echo "1.Let's put the text into the buffer:"; echo $clipboard->put_text("seo")." n"; //2 echo "2.Go to the page and set focus:"; echo $browser->navigate("http://google.com").""; echo $input->set_focus_by_number(0)." n"; //3 echo "3.Paste the text from the buffer:"; echo $browser->paste()." n"; sleep(2); //4 echo "4.Go to the page and set focus:"; echo $browser->navigate("http://google.com").""; echo $input->set_focus_by_number(0)." n"; //five echo "5.Paste the text from the buffer:"; echo $browser->paste("new text"); //end echo "

    "; //Quit $app->quit(); ?>
    Python example: # Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7013" from xweb_human_emulator import * # Start echo("
    browser.xxxxxxxxx
    ") # 1 echo("1.Put the text in the buffer:") echo(clipboard.put_text("seo"), " ") # 2 echo("2.Go to the page and set focus:") echo(browser.navigate("http://ya.ru"), "") echo(input.set_focus_by_number(0), " ") # 3 echo("3.Insert text from buffer:") echo(browser.paste(), " ") # 4 echo("4.Go to the page and set focus:") echo(browser.navigate("http://ya.ru"), "") echo(input.set_focus_by_number(0), " ") # five echo("5.Insert text from buffer:") echo(browser.paste("new text")) # end echo("

    ") # Quit app.quit()
    C# example: #region using using System; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.IO; using System.Text; using System.Threading; using XHE; using XHE.XHE_DOM; using XHE.XHE_System; using XHE.XHE_Window; using XHE.XHE_Web; #endregion class Program: XHEScript { static void Main(string [] args) { //init XHE server = "127.0.0.1:7013"; InitXHE(); //Start echo("
    browser.paste
    "); //1 step echo("1.Let's put the text into the buffer:"); echo(clipboard.put_text("seo") + "
    "); //step 2 echo("2.Let's go to Yandex:"); echo(browser.navigate("http://ya.ru") + "
    "); //step 3 echo("3.Let's focus on the search string:"); echo(input.set_focus_by_number(0) + "
    "); //step 4 echo("4.Insert text from buffer:"); echo(browser.paste()); //step 5 echo("5.Let's go to Yandex:"); echo(browser.navigate("http://ya.ru") + "
    "); //step 6 echo("6.Let's focus on the search string:"); echo(input.set_focus_by_number(0) + "
    "); //step 7 echo("7.Set focus to the search string:"); echo(input.set_focus_by_number(0) + "
    "); //step 8 echo("8.Paste the text from the buffer:"); echo(browser.paste("new text")); //end echo("

    "); app.quit(); } }
    Java Script example: //connect the object to control the emulator, if not already connected xhe_host = "127.0.0.1:7013"; echo = require("../../../Templates JS/xweb_human_emulator.js"); //Start echo("
    browser.paste
    "); //1 step echo("1.Let's put the text into the buffer:"); echo(clipboard.put_text("seo") + " n"); //step 2 echo("2.Let's go to the page and set the focus:"); echo(browser.navigate("http://ya.ru") + ""); echo(input.set_focus_by_number(0) + " n"); //step 3 echo("3.Insert text from the buffer:"); echo(browser.paste() + " n"); //step 4 echo("4.Let's go to the page and set the focus:"); echo(browser.navigate("http://ya.ru") + ""); echo(input.set_focus_by_number(0) + " n"); //step 5 echo("5.Paste the text from the buffer:"); echo(browser.paste("new text")); //end echo("

    "); //Quit app.quit();