Code: Select all
this is a long block of code I want to copy
xxx
xxx
xxx
Code: Select all
this is a long block of code I want to copy
xxx
xxx
xxx
Code: Select all
^+c::
KeyWait c
KeyWait control
KeyWait shift
ClipBoard := ""
Send ^c
ClipWait 1
UrlDownloadToFile, % ClipBoard, % A_ScriptDir "\htmldata.txt"
If ErrorLevel
{
msgbox, There was an error...
exitapp
}
FileRead, OutVar, % A_ScriptDir "\htmldata.txt"
OutScript := ""
Loop, parse, % OutVar, `n,`r
{
If InStr(A_LoopField, "<div class=""codebox""><p>Code")
CopyYN := true, continue
else if InStr(A_LoopField, "</Code")
break
If CopyYN
OutScript .= A_LoopField "`n"
}
Clipboard := OutScript
Filedelete % A_ScriptDir "\htmldata.txt"
msgbox Script copied to Clipboard
exitapp
Use the shift key in chromemilkygirl90 wrote: ↑09 Jun 2021, 19:43Not all Forums have a "select all" button in the Code block. For those that don't, is there a quick method I can use to easily copy/paste the entire block, instead of manually highlight start and end of the code block?
Code: Select all
this is a long block of code I want to copy xxx xxx xxx
use the shift key in chrome
Move your mouse to the first line you want to copy
Left click highlight first line or letter
Move to the last letter on the data you want to copy and click shift and hold down left mouse
that is exactly what I'm trying to avoid.instead of manually highlight start and end of the code block?
Code: Select all
#IfWinActive, ahk_class IEFrame
q:: ;internet explorer - get element under cursor
;regardless of zoom percentage of 'Internet Explorer_Server' control
;it could potentially be incorporated into iWB2 Learner
IID_IWebBrowserApp := "{0002DF05-0000-0000-C000-000000000046}"
IID_IHTMLWindow2 := "{332C4427-26CB-11D0-B483-00C04FD90119}"
CoordMode, Mouse, Screen
MouseGetPos, vMouseX, vMouseY,, hCtl, 3
WinGetClass, vCtlClass, % "ahk_id " hCtl
if !(vCtlClass == "Internet Explorer_Server")
return
if !(oDoc := ComObject(9,ComObjQuery(Acc_ObjectFromWindow(hCtl),IID_IHTMLWindow2,IID_IHTMLWindow2),1).document)
return
oWin := ComObject(9,ComObjQuery(oDoc,IID_IHTMLWindow2,IID_IHTMLWindow2),1)
oWB := ComObject(9,ComObjQuery(oWin,IID_IWebBrowserApp,IID_IWebBrowserApp),1)
vLogicalXDPI := oWB.document.parentWindow.screen.logicalXDPI
vDeviceXDPI := oWB.document.parentWindow.screen.deviceXDPI
vZoomRatio := vDeviceXDPI / vLogicalXDPI
;vWinX := oWin.screenLeft, vWinY := oWin.screenTop
;WinGetPos, vWinX2, vWinY2, vWinW2, vWinH2, ahk_class IEFrame
WinGetPos, vCtlX, vCtlY, vCtlW, vCtlH, ahk_id %hCtl%
vMouseX2 := (vMouseX-vCtlX)*(1/vZoomRatio)
vMouseY2 := (vMouseY-vCtlY)*(1/vZoomRatio)
oElt := oWin.document.elementFromPoint(vMouseX2, vMouseY2)
msgbox % oElt.Innertext
oDoc := oWin := oWB := oElt := ""
return
#IfWinActive
esc::exitapp
Users browsing this forum: chubbychub and 41 guests