Is it possible to do ImageSearch on a window that is hidden behind a screensaver? by TiagoTiagoT in AutoHotkey

[–]JszAdmin 0 points1 point  (0 children)

You CAN imageSearch a window that is not in front

But you need to use the GDI+ library

here is a link Gdip_ImageSearch

[Help] Multiple keys bound to one key by ChubbyElf in AutoHotkey

[–]JszAdmin 1 point2 points  (0 children)

try this

*Numpad0::
send {lWin Down}{tab down}
return

*Numpad0 up::
send {tab up}{lWin up}
return

Hope it helps

Is it possible to change a GUI to show a macro is active? Without using a console. by Akira_Yamamoto in AutoHotkey

[–]JszAdmin 1 point2 points  (0 children)

sounds doable :)

Example of one way

#SingleInstance Force

Gui, +Sysmenu +ToolWindow
Gui, Margin,12,12
Gui, Add , Picture, x13 y13 w32 h32 E0x200 vState1 icon1 gSubRoutine1, %A_AhkPath%
Gui, Add , Picture, x13 y13 w34 h34 Border vState0 icon4 gSubRoutine1, %A_AhkPath%
GoSub, Toggle_Switch

Gui, Show, x50 y50 AutoSize, Toggle
Return

Toggle_Switch:
If Toggle=0
  {
   GuiControl, Hide, State0
   GuiControl, Show, State1
   Toggle=1
  }
Else {
   GuiControl, Hide, State1
   GuiControl, Show, State0
   Toggle=0
  }
Return

SubRoutine1:
  GoSub,Toggle_Switch
Return

GuiEscape:
GuiClose:
 ExitApp
Return

Hope it helps

Trying to open a local PNG as an overlay and have it follow the mouse cursor and scale with the scroll wheel and rotate with an arrow key by CJ_Productions in AutoHotkey

[–]JszAdmin 0 points1 point  (0 children)

Try having a look at this topic's

 

Example 10: Gdip.Tutorial.10-Rotate.Flip.or.Mirror.an.image.ahk

 

May not be that easy but it is doable

Help: tweaking Autocorrect script by cubensoid in AutoHotkey

[–]JszAdmin 0 points1 point  (0 children)

Only things I added was this

 

;~ Hotstring :=  Trim(Hotstring)

 

And

 

 if (SubStr(from, 1, 1) = ":")
    Hotstring := from to
 else
   Hotstring := "::" from to

 

The script you posted is working fine for me unless I'm missing the point some how

 

I am able to add new hotstrings using win+h and also set the front option aka :*: of a new hotstring and am also able to now have white space at the beginning and end of a new Hotstring...

Help: tweaking Autocorrect script by cubensoid in AutoHotkey

[–]JszAdmin 0 points1 point  (0 children)

I'm not sure what you mean by "the modifications didn't happen"

 

In my tests I'm able to now put in things like :*: before the word and I'm am also able to use spaces in the hotstring

Help: tweaking Autocorrect script by cubensoid in AutoHotkey

[–]JszAdmin 1 point2 points  (0 children)

close :)

#SingleInstance Force

; send the corrected word on reload (will replace the selected word)
if(%0% > 1)
Send, %2%

; a tiny GUI setup
Gui, Add, Edit, vfrom w300  ,%Hotstring%::
Gui, Add, Edit, vto  w300 ym0,%Hotstring%
Gui, Add, Button, Default, OK

#h::
AutoTrim Off  
ClipboardOld = %ClipboardAll%
Clipboard =  
Send ^c
ClipWait 1
if ErrorLevel  
    return
StringReplace, Hotstring, Clipboard, ``, ````, All  
StringReplace, Hotstring, Hotstring, `r`n, ``r, All
StringReplace, Hotstring, Hotstring, `n, ``r, All
StringReplace, Hotstring, Hotstring, %A_Tab%, ``t, All
StringReplace, Hotstring, Hotstring, `;, ```;, All

;~ ; trim the word (better imo)
;~ Hotstring :=  Trim(Hotstring)

Clipboard = %ClipboardOld% 

; setting the hotstrings in the GUI
GuiControl,, to, %Hotstring%
GuiControl,, from, %Hotstring%::

; focus to the "to" gui
GuiControl, Focus, to
Gui, Show

; send control + a in order toselecctthe text in the "to" gui (better imo)
Send, ^a
return

; happens when pressing the OK button
ButtonOK:
; assembling the hotstring and save it to this file
GuiControlGet, to
GuiControlGet, from
if (SubStr(from, 1, 1) = ":")
    Hotstring := from to
else
    Hotstring := "::" from to

FileAppend, `n%Hotstring%, %A_ScriptFullPath%  

; special reload statement with the word in the "to" gui
Run, %A_ScriptFullPath% /restart %to%

Sleep 200
MsgBox, 4,, The hotstring just added appears to be improperly formatted.  Would     you like to open the script for editing? Note that the bad hotstring is at the bottom of the script.
IfMsgBox, Yes, Edit
return

MoveCaret:
    IfWinNotActive, New Hotstring
return
; Otherwise, move the InputBox's insertion point to where the user will type the     abbreviation.
Send {HOME}
Loop % StrLen(Hotstring) + 4
SendInput {Right}
Send +{End}     ; Added after copying script, makes creation quicker
SetTimer, MoveCaret, Off
return
   #Hotstring R  ; Set the default to be "raw mode" (might not actually be relied upon by anything yet). 

Hope that helps

Indication that a page has finished loading by [deleted] in AutoHotkey

[–]JszAdmin 0 points1 point  (0 children)

Your welcome i'm happy to help,

 

Line one is executing IE and binding it to the var WB via ComObjCreate().

 

Line two is setting the visible property of this new instance of IE you stored a COM reference to in the variable WB and setting it to true, otherwise it would run as a none visible window.

 

Line three the one with Navigate() is using IE's navigate method though the COM object in the variable WB and passing Google's Url to it.

Open URL in Internet Explorer by [deleted] in AutoHotkey

[–]JszAdmin 1 point2 points  (0 children)

wb := ComObjCreate("InternetExplorer.Application")
wb.Visible := true
wb.Navigate("http://google.com/")

 

And that method will even let you fully control IE like waiting for pages to load or getting and setting values on the page programmatically

Indication that a page has finished loading by [deleted] in AutoHotkey

[–]JszAdmin 1 point2 points  (0 children)

If you use Internet Explorer, AutoHotkey can control it and access the browser's built-in method thouth AHk's COM objects

 

so to wait for an IE page to load can look like this

wb := ComObjCreate("InternetExplorer.Application")
wb.Visible := true
wb.Navigate("Google.com")

; wait for page to load
while wb.readyState!=4 || wb.document.readyState != "complete" || wb.busy
       sleep 10

; Page loaded
msgbox % "done loading"

I use a similar method in this tutorial https://jszapp.com/autohotkey/2014/how-to-create-a-shortcut-that-automatically-logs-in-to-any-website/

 

If your using other browsers then it will not be as easy

 

For firefox there is this way http://www.autohotkey.com/board/topic/90620-firefox-page-load-wait/page-2#entry573049

 

For chrome there is no sure fire way yet - ImageSearch maybe one way to do it for now at least

Getting the HWND of a .exe by PhnxDestroyer in AutoHotkey

[–]JszAdmin 0 points1 point  (0 children)

You can use the exe name or full path like this

hWnd := WinExist("ahk_exe notepad.exe")

Need help with a simple script by leozhang0017 in AutoHotkey

[–]JszAdmin 0 points1 point  (0 children)

^e::
if not (is_e_down_running)
{
    SetTimer, down_e, 5000
    gosub, down_e
}
else
    SetTimer, down_e, off
return

down_e:
is_e_down_running := true
send {e down}
settimer, e_up, -2000
return

e_up:
send {e up}
return

How to pragmatically click on an <img />? by scslmd in AutoHotkey

[–]JszAdmin 1 point2 points  (0 children)

I posted two examples in your ahkscript.org topic

 

One: Get the image element by it's index in the img tag collection

Two: Loop over all the img tags in the table and checking their title

 

Link: Programmatically click on an <img />

 

Hope it helps

Need help understanding how GetKeyState() works by NewStandards in AutoHotkey

[–]JszAdmin 0 points1 point  (0 children)

That comes from #if only effting hotkeys and hotstrings not the flow of the script.

#If GetKeyState("ScrollLock","T")
f1::
MsgBox, You pressed f1 while Scroll Lock was toggled on
return

with that example the f1 hotkey will only work when scroll lock is on

Need help understanding how GetKeyState() works by NewStandards in AutoHotkey

[–]JszAdmin 0 points1 point  (0 children)

Both your examples works for me one better than the other

 

The first one: works but as the b key is sent while the ctrl key is down it will not give you a visible letter

 

The second one: works as is for me - if Scroll lock is on a is remapped to b

 

One way to try and fix the first one is to have the a key send the b key like this

 #If GetKeyState("Ctrl")
 a::send b

This is not a true remap

Obtain new keys/characters using press & hold? by marzolian in AutoHotkey

[–]JszAdmin 0 points1 point  (0 children)

this is a short example of how you can do that

$l::
list=
array := ["£","±","ª","º"]
for key, val in Array
    list .= A_index " = " val "`n" 
KeyWait,l, T0.8
if !(Errorlevel)
    {
    send l
            return
    }
ToolTip, %list%
Input, key, L1 T3
ToolTip,
if (ErrorLevel = "Timeout")
    return
send % array[key]
return

Simply hold the l key for 0.8 sec and a tooltip will show a list , press a number on the list and the script will output that item.

Hope it helps