Put text into fld at a website
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
Re: Put text into fld at a website
I want to display the value in the field that is visible at the browser and than make some action with it (only in the field that is visible).
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Put text into fld at a website
You can send a JavaScript call to the browser instance to work with the browser, but if the ultimate goal were to fill in the form and send it to the server that could be done super-easy with the POST command.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Livecode Opensource Backer
Re: Put text into fld at a website
Can you tell me how to send a javascript call to the browser?
I only want to put the text into that field. Thats all.
I only want to put the text into that field. Thats all.
Re: Put text into fld at a website
You can do
Launch URL "https://www.google.com/search?ie=UTF-8&q=LiveCode"
to send a search request to Google.
Launch URL "https://www.google.com/search?ie=UTF-8&q=LiveCode"
to send a search request to Google.
Andy .... LC CLASSIC ROCKS!
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Put text into fld at a website
Filtering the Dictionary with "revBrowser" I found revBrowserExecuteScript.User87 wrote:Can you tell me how to send a javascript call to the browser?
I only want to put the text into that field. Thats all.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Livecode Opensource Backer
Re: Put text into fld at a website
I don't get this work with and external browser. In addition to that I have no control of the website on which I want to put text in the form (field).
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Put text into fld at a website
Correct, the revBrowser commands only work with an embedded browser in LiveCode. Controlling an external browser may be tricky - what OS are you on, and can you point us to other apps that do what you're looking for so we can see how they work?User87 wrote:I don't get this work with and external browser. In addition to that I have no control of the website on which I want to put text in the form (field).
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Livecode Opensource Backer
Re: Put text into fld at a website
I am using Windows 10 and Mac OSX (it hneed to work on both systems). I want to control Firefox. I don't use other apps. Only the livecode app with the button (I explaned it in my first post).
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Put text into fld at a website
Whenever you want to build something you've never seen any other app do it's helpful to expect the need for some research.User87 wrote:I am using Windows 10 and Mac OSX (it hneed to work on both systems). I want to control Firefox. I don't use other apps. Only the livecode app with the button (I explaned it in my first post).

The question here is: what mechanisms does Firefox provide for allowing other apps to manipulate the content of web pages displayed within it.
For security reasons the answer may be "none", since if outside apps could alter page contents then a malware installed on the system could wreak all sorts of havoc.
But it may also be that Firefox has a more lax approach, based on the old adage that "physical access equals root" anyway. If so, it may be that they provide hooks by which other apps can control it.
On OS X the most common means by which apps can control each other is AppleScript. You can open up Firefox in the AppleScript editor and see what options it provides. All OS X apps are required to support a few AppleScript events, but the sort you're looking for may or may no be provided. If you see anything like the ability to execute JavaScript within a page, that would allow you to send the JS within an AppleScript to Firefox using LC's "do...as" syntax.
Similarly, it may be that Firefox on Windows includes support for Powershell or other Windows scripting solution. Not sure, but a little time at the Firefox developer site should provide the info you're looking for. If there is such a hook the method would be similar to Mac, using "do...as <externalScriptingLanguage>" or perhaps calling a Powershell script via LC's shell function.
Seems like a lot of work, though. Can you describe the goal of this? Perhaps there's another way to meet that goal with fewer moving parts.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Livecode Opensource Backer
Re: Put text into fld at a website
Yes this seams to be a lot of work.
The goal is:
I have my LC-App which includes a pull-down-menu with text files linked.
I want the LC-App to put the text into the field at the website in the external browser.
The website in the external browser include other text information. And all the text information together I send via mail (sending via mail has to be done via the website it is not possible/allowed to do this via another LC-App.)
The goal is:
I have my LC-App which includes a pull-down-menu with text files linked.
I want the LC-App to put the text into the field at the website in the external browser.
The website in the external browser include other text information. And all the text information together I send via mail (sending via mail has to be done via the website it is not possible/allowed to do this via another LC-App.)
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Put text into fld at a website
If I understand that correctly we could distill the goal to the last step, since the first are just means to that goal:User87 wrote:The goal is:
I have my LC-App which includes a pull-down-menu with text files linked.
I want the LC-App to put the text into the field at the website in the external browser.
The website in the external browser include other text information. And all the text information together I send via mail (sending via mail has to be done via the website it is not possible/allowed to do this via another LC-App.)
Goal: send data from a form on a web page to a server so it can send that data in an email
To accomplish that we don't need an external browser at all, nor even an embedded one. We merely need a way to submit the form data to the server the page comes from. And for that we can use a field in a LiveCode stack to enter the data and then use LiveCode's built-in POST command to send that to the server, as I'd suggested earlier and is outline here in this handy brief tutorial:
http://livecode.byu.edu/internet/postMethodSteps.php
The server doesn't care whether the data is being sent via POST to it from Firefox, or Chrome, or any other specific client. LiveCode is as good as anything else as far as the server is concerned. But as far as your project is concerned, I can think of no simpler way to accomplish the goal than doing this directly in LiveCode with the POST command.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Livecode Opensource Backer
Re: Put text into fld at a website
Hmm I add a picture with an overview what I want to do. Please have a look at it.FourthWorld wrote:If I understand that correctly we could distill the goal to the last step, since the first are just means to that goal:User87 wrote:The goal is:
I have my LC-App which includes a pull-down-menu with text files linked.
I want the LC-App to put the text into the field at the website in the external browser.
The website in the external browser include other text information. And all the text information together I send via mail (sending via mail has to be done via the website it is not possible/allowed to do this via another LC-App.)
Goal: send data from a form on a web page to a server so it can send that data in an email
To accomplish that we don't need an external browser at all, nor even an embedded one. We merely need a way to submit the form data to the server the page comes from. And for that we can use a field in a LiveCode stack to enter the data and then use LiveCode's built-in POST command to send that to the server, as I'd suggested earlier and is outline here in this handy brief tutorial:
http://livecode.byu.edu/internet/postMethodSteps.php
The server doesn't care whether the data is being sent via POST to it from Firefox, or Chrome, or any other specific client. LiveCode is as good as anything else as far as the server is concerned. But as far as your project is concerned, I can think of no simpler way to accomplish the goal than doing this directly in LiveCode with the POST command.
Are you still shure it will work what you told me?
Re: Put text into fld at a website
What you intend to do is
= fill the form on the webpage and
= use a "send by mail button" from the webpage?
As long as you don't know exactly what it's sending (may also additional hidden data what each browser knows about you) this will be difficult. If you know, then Richard will tell you how to do that (I would ask him too).
Also you could think about an easier approach like using a "hotkey tool" (Hotkey on Win, Spark on Mac).
= fill the form on the webpage and
= use a "send by mail button" from the webpage?
As long as you don't know exactly what it's sending (may also additional hidden data what each browser knows about you) this will be difficult. If you know, then Richard will tell you how to do that (I would ask him too).
Also you could think about an easier approach like using a "hotkey tool" (Hotkey on Win, Spark on Mac).
shiftLock happens
-
- Livecode Opensource Backer
Re: Put text into fld at a website
If I click the "send by mail button" it first shows a summary of the texts. (Where you can check if it's ok and than push the button send mail is shown)[-hh] wrote:What you intend to do is
= fill the form on the webpage and
= use a "send by mail button" from the webpage?
As long as you don't know exactly what it's sending (may also additional hidden data what each browser knows about you) this will be difficult. If you know, then Richard will tell you how to do that (I would ask him too).
Also you could think about an easier approach like using a "hotkey tool" (Hotkey on Win, Spark on Mac).
The button I considure only shows the next side with that summary and it does:
<input id="set_status" class="submit" type="submit" value="Continue" name="set_the_status" style=""></input>
But I think this is not what you wanted to know?
And it is as you said that there shure will be some hidden action. :-/
Re: Put text into fld at a website
Probably Richard wants to know the source code of that next page with the summary
(the one you can view and copy in the browser in developer views, in firefox with developer tools often cmd-U on Mac and ctrl-U on Win).
What you could also do: Use one of the Firefox AddOns.
Also: some of them are open source, so you could look there how they do it with js, for example HERE (Autofill Forms on github).
(the one you can view and copy in the browser in developer views, in firefox with developer tools often cmd-U on Mac and ctrl-U on Win).
What you could also do: Use one of the Firefox AddOns.
Also: some of them are open source, so you could look there how they do it with js, for example HERE (Autofill Forms on github).
shiftLock happens