I would like to write "hello world", no in the code but in the page linked to the script

Thanks to you too, for your suggestion.
I had thought of this solution but it forces me not to update the web page.
I need the web pages to be managed by me and must not be fixed, but always interchangeable with the text box inside, which must allow the user to enter his own text and send it to a texbox, whenever he wants. he.

You can use css / inline styling to size your input box.

See attached aia project

returnwvs.aia (2.4 KB)

Thanks, it works but I don't know how to resize the text area, make it multiline.
I'm not familiar with CSS

Thanks, it works but I don't know how to resize the text area, make it multiline.
I'm not familiar with CSS
Is it not possible to carry out the transfer operation with a button in the app instead of on the web page?

It may be better to use a "textarea" instead of a "text" as input.

Yes, you can send a value using the webviewstring to the page, and add more/different javascript to call/handle the return of the text content to the new webviewstring value.

I know that you believe me capable of doing it, I will try as I have been trying to do for about three days but without results, so I turned to the forum.

I had the code that I posted, but this script, to transfer the text to a label or a texbox, needed the text to be reported in the html code and therefore in the script.

é Certainly it worked and it was simple, but I as written, I needed to write the text outside, directly on the web page and from there to bring it back, as you did in an unalabel or in a textbox, which is already, a great help really and you I am grateful.

I am not able to render the text box multiline, I have searched this on the net, and I have found the code that I have posted in this thread, but not knowing how to insert it in the script nopn I could proceed.
Let's connect an external button to the page, to the code.

Thought you might say something like that :wink:

Try this aia project

returnwvs2.aia (3.2 KB)

html:

<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<head>
	<title>ShowAndReturn</title>
	<style>
	textarea { font: 12px "Arial"; }
	</style>
</head>
<body>
	<br><br>
	<textarea id="textbox" rows="8" cols="40" style="border:solid 2px black;"></textarea>
	
	<script>
		setInterval(function () {
		var wvs = window.AppInventor.getWebViewString();
		if (wvs == "fetch") {
			getText();
		}
		}, 1000);
			
	function getText() {
		var myText = document.getElementById("textbox").value;
		if (myText != "") {
		document.getElementById("textbox").value = '';
		window.AppInventor.setWebViewString(myText);
	    }
	}
	</script>
</body>
</html>

I tried to insert a textarea, but as you see I don't really know how to connect it to I tried to insert a textarea, but as you see I don't really know how to connect it to the button by replacing the other smaller textbox.

here you can write your text How should I enter it? where should i insert it? what should i delete? How can I connect the button to the new larger box and transfer the text to the label? Unfortunately sorry but I don't know anything about codie html. i have created sites sometimes am i created them using block programs without writing code.

Great, thanks but the button to transfer the text is missing.

You want to transfer text from a label/textbox in the app, to the textbox in the web page ? - the complete opposite of what is happening in my last aia project ?

Excuse me but I had not seen your last project, now I try it, with all these messages, I went out of my mind, I struggle to follow everything, among my dozens of tests to try not to disturb you and your help, I go haywire thanks now try again.

Well here is another aia project that sends text to the webview and retrieives it.

returnwvs3.aia (4.1 KB)

You have been great, you really deserve every compliment not only from me, but also from whoever created this forum, which I thank.
Timal2, a warm thanks you have solved a huge problem for me and if the App is successful I will not forget any of you.

Excuse me again Timal2, is it possible not to have the text deleted from the textbox when transferring the text?

Yes it is. remove or comment // this line in the html file:

document.getElementById("textbox").value = '';

Great thanks

Hi Angelo - are you going to tell us why you are using a WebView with a local web page (not on the internet) instead of a simple App Inventor TextBox? What is the reason for sending text to a web page and then retrieving it?

Not being able to have Google voice read only the text of a web page composed of images and more, my idea was to detect the text from the web page and then directly transfer the text from the web page to a textbox, in this case everything would have been easier, but not knowing how to connect from appinventor to the text section contained in the page, (and only to that section), or opted for this solution.

But if you are able to do this directly from the webpage to the texbox without using a text box, that would be super cool and would save you a lot of work.

In a nutshell, if I have a user who creates web pages with block software, then writing and formatting text, also inserting images, without writing a line of code, and wants to send this page, to offer to another user, the option to have the page read by Google voice, the only way, it seemed to me to be, the solution that I had asked Timal2, in fact, is to report this text in a text box.

I tried to experiment but I didn't succeed and then after days of useless tests, I asked for help at the forum and Timal2, it really helped me a lot and in the absence of anything else, I think I found a fantastic and for the moment, better solution possible. Of course I also thank the others who have tried to do so.

Actually connecting to the local page limits me a lot, the best solution as I wrote would be that the user can create his web page, with any software, publish it and then appinventor loads it directly from the web, making it read directly with a button.

That's the explanation you needed to start your Topic with. So:

  1. Grab text from webpage online
  2. Run Text - to - Speech on that text

This means we cannot use AppInventor's getwebviewstring unless the User creating the web pages can include App Inventor's function, which requires a bit of HTML + JavaScript skill. It's basically impossible to automatically grab specific sections of a random webpage, but Web Get can grab all of the text.....

In fact, it is precisely for this reason that I have chosen the solution of writing the text in a text box and then transferring it to the textbox.

This will involve adjusting the text box so that it does not go off the mobile phone display, if viewed on mobile phones with large displays or tablets or TVs. But I will study to solve the problem.

But I would like to add my idea, which will surely come close to the heresy of one who knows html as ignorant on the subject.

But if I create a web page and insert a text, when I publish it, this text within the code will be positioned between some tags (I hope they are called that, the sections that delimit the text in the code therefore being a web page, which I am preparing myself, I know perfectly well that I have to insert only one piece of text and not several, so that text will be between two tags, it is not possible as with web get, to connect to these tags and extract the text?