Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save CanYouJustWorkPlease/de51103e65d3a570c7bf90e45dc75267 to your computer and use it in GitHub Desktop.

Select an option

Save CanYouJustWorkPlease/de51103e65d3a570c7bf90e45dc75267 to your computer and use it in GitHub Desktop.

Revisions

  1. CanYouJustWorkPlease created this gist Nov 30, 2020.
    45 changes: 45 additions & 0 deletions Jump to the start of bookmark text for Chrome stable.ahk
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    ;~ You have to have installed Dark Reader Chrome extension, then take a snapshot of the extension's icon
    ;~ and save it on your PC.
    ;~ For it to work, you have to calculate the new values, as they are likely to differ from mine.
    ;~ Use Windows Spy, the AutoHotkey feature, to help in calculating the new values, coordinates.

    ;~ To use it, left click the star for adding a bookmark. As the panel opens, the cursor will jump at the
    ;~ start of the text.

    ;~ As an alternative, you can use CTRL + D hotkeys to achive the same, as their functionality
    ;~ was overriden with a new one. Also, this alternative is more reliable than the one with
    ;~ left clicking the star.

    ;~ This script is only useful when used in combination with the "Prepend !! VERY IMPORTANT to page title" bookmarklet
    ;~ and the like, which are found in my gists, because in some cases the title is so long that it prevents to check if the importance was indeed
    ;~ prepended to it, that's why the need of jumping at the start of the title during bookmark saving.


    SetTitleMatchMode RegEx

    #If WinActive("ahk_exe ^C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe$")
    CoordMode Pixel


    loop
    {
    ImageSearch, FoundX, FoundY, 391, 30, 1230, 83, D:\Downloads\dark reader.png

    x1 := FoundX - 102
    y1 := FoundY + 9
    x2 := x1 + 40
    y2 := y1 + 22

    if (ErrorLevel = 0) {
    MouseGetPos, x,y
    if (x > x1 and x < x2 and y > y1 and y < y2){
    GetKeyState, state, LButton
    if (state = "D") {
    Sleep, 100
    Send, {Home}
    }
    }
    }
    }

    $^d:: Send, {LControl Down}{d Down}{d Up}{LControl Up}{Home}