NodeJS, Copying text from another application - javascript

Hi guys I have a problem which I have couldn't solve after researching for quite some time. It is the following:
The copying of text from the GUI of another application (without having access to the other application programmatically)
For example:
copy the text of a word file while the application is open and is being worked on.
copy the text of an email while a email application is open and is being worked on.
I am not even sure if this is possible but would love any suggestions.

you can capture the screen then use OCR's technique to extract text from image.

Related

Change the Value of Scratch Variables with a Bookmarklet

I am making an engine on Scratch that works with a bookmarklet to provide more functionality without creating a Scratch extension. I have had no trouble reading variables through the DOM when they are showing. However, I am trying to find a way to change the values of the variables so that the bookmarklet can return data to the engine instead of just reading data. The link to the project is https://scratch.mit.edu/projects/574836102/.
I have searched Google and read the Blockly documentation, and couldn't find anything. Scratch has also appeared to have removed the "Blocks", "Variables", and "JavaScript" from the Blockly object. Does anyone know a way that I can write to project variables so the project can read them?
i have not found a way to make a Bookmarklet change a Variable, but i found an other idea...you could make in your scratch project a [ASK()] block and insert text in to the answer. i found 2 bookmarklets 1 does the inserting text and the other presses the enter button, but i did not found a way to get it displayed in the answer Variable... i think the problem is it does not record it as a Users input and does not store it...
https://scratch.mit.edu/projects/610547353/
my remix press space and then 1st bookmarklet and 2ond bookmarklet.
First bookmarklet
javascript: var els=document.getElementsByClassName("question_question-submit-button_3nYah"); if(els.length == 0) alert("Button not found"); else els[0].click();
Second Bookmarklet
javascript:(function(a){a.value=a.value.slice(0,a.selectionStart)+"Hello"+a.value.slice(a.selectionEnd);})(document.activeElement);

Saving HTML code as its own application

How do I save or convert the HTML code into its own program? For example: I want to double click on the file on my desktop to open up as its own application. I don't want it to open through Notepad++ or any other program.
The best way I can explain this is: look at all of your desktop icons. When you double click something it runs on its own. It doesn't need Notepad++ or whatever coding program you used to open up first. Now implementing that exact same concept to my question. I want to open the program I have coded in it's own window.
I hope that makes sense. I don't want to show my code because it's original.
EDIT: The HTML code consists of CSS and JS. Can I open it without a browser? Example: Visual Basics you can create window applications. I was wondering if I could do the same thing except with HTML code?
Thank you in advance!
You right click on the icon, and choose Open With: which should bring up a list of applications you can use to open that type of file.
And you can browse to the location of the program you want to use to open the file.
Hope that helps.
HTML is not compiled into anything, and thus cannot be run independently. It must be interpreted by a browser or other similar piece of software.
If you have written what you deem a 'program' in HTML/JavaScript, then your best bet would be to host it somewhere and bookmark the page to your desktop. I hope this answers your question...

Take screen shot of picture within web app

I'm working on this webapp here http://dogeify.me/ and I have completely redone it as Flask app (not hosted at that URL, yet).
Essentially, you drag the text that you create using jQuery in order to make the doge meme.
I am trying to figure out the best python solution for taking a screenshot within the web app so that the user will be able to save their picture. Is a screenshot even the best option, or is there any way to select all of the DOM elements and save them as a file? Maybe it isn't even a python solution, as I had previously tried http://html2canvas.hertzen.com/ but I wasn't too happy with the results.
If I had to summarize my question: How can I save an image that has draggable jQuery text overlayed onto it so that the saved image contains both the background and the draggable text?
As discussed in this answer, you can render the html (you can create a page with just your doge and jQuery-overlaid text) to image using QtWebKit. You would need to install Qt (PyQt4 or PySide) on your server in that case.

Javascript to move selected web text to MS Word

Im annoyed that this doesn't seem possible, but i wanted to check with the community to see if someone has developed a working version of something similar.
I'm a graduate student and spend a LOT of time online researching, and when I find that sweet paragraph that makes just the argument I've been searching for, I've gotta copy and paste it out of chrome (on mac os x) and into word (2011). I've built a "strip all formatting" macro that works well enough, but what i would like is a pipe from chrome into my open word document that gives me 1 key "send selection to word document" (like ~).
I've got the js working to get selected text and move it around, but i cannot seem to open the document i want to move the text into. Ideally, this would work as a chrome plugin (I've built them before), but I've seen no documentation about JS => Word on other platforms (obviously activeX controls dont work for me).
Any suggestions?
You can use an automator service to do this. Open Applications > Automator, and then create a service, which receives selected text (one of the built in defaults). This works in any app, and is accessible via the Services menu when you right click.
You can do this easily with TextEdit for example using these two actions:
Service receives selected text
New Textedit Document.
I've just tried it to confirm it. It can also copy rich text etc (including links) if you want. I imagine something similar is possible with word, and there is a built in service already to do the same if you have installed TextWrangler (another word processor).
JavaScript is contained within the browser for security reasons, so you will not be able to do it with JavaScript.
The best thing that i can come up with is to write a 'bot' kinda thing that just coppy pastes, so not for in an extention.

What is involved in making entry of text into a web app into all javascript?

What I am talking about is similar to what Google Docs did with the word processor. I want to be able to enter text without using a <textarea> but the javascript hard coding it in. How would you do this? Any ideas?
I don't think it's possible but You can you an modify textarea itself using CSS so the user will not feel that this is actually text area is. I believe that this is what Google docs are doing. Just good CSS work.

Categories