You have many code sample boxes in the Questions and Answers in stackoverflow
I want this: if i go to that box, that i can do in ONE CLICK f2 save the text from that box direct to a file.
The autohotkey (AHK) script must do this:
- Select all text in box
- Copy the text to clipboard
- Save the text to a file (example.ahk)
This script does not work.
; ^ = Ctrl
; ! = Alt
; # = Win (Windows logo key)
; + = Shift
f2::
; this does not work it will select all text from the website
; but i want do that it select all the text in that box
; and then save it direct to a file
send ^a
send ^c ;copy selected text to clipboard
FileAppend, %Clipboard%, %A_MyDocuments%\example.ahk ;save clipboard to file
return
^a
selects all the text in a browser document, not just the currently selected "code box". Anyway, AHK can't get you very far since modern browsers don't expose any content of their documents. Injecting native JavaScript into the browser document (e.g. with a User script) is the most powerful option. – MCL