Detect input types with AutoHotKey Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
cheeseflavoredsnacks

Detect input types with AutoHotKey

14 Jul 2018, 14:25

I just started using autohotkey today and I'm wondering if this it possible, here's what I need... Normally when you right click over an html input, a dropdown appears with options like cut copy paste, ect. I want it to not show those options, and automatically do a paste. This script works...

Code: Select all

RButton::
Click
Send ^v
The script above first does a left click to put focus on the input, then pastes into it. What I need now is to have it do something different depending on the input type. if it is input type="number" the code above is fine. if it's input type="text" I want to do the same thing, but add an {enter} at the end so the code would be something like this...

Code: Select all

    RButton::
    Click
    if the input type I just clicked on equals "number" 
    Send ^v
    if the input type I just clicked on equals "text"
    Send ^v{enter}
    return
I'm not sure how to properly write this script or if autohotkey can even check for different input types. Thanks
garry
Posts: 3764
Joined: 22 Dec 2013, 12:50

Re: Detect input types with AutoHotKey  Topic is solved

15 Jul 2018, 09:07

this is just an example , copy marked text (F6) and see if it's a number

Code: Select all

~$F6::
Send ^c
cl:=clipboard
if cl is number
  msgbox,%cl% is number
else
  msgbox,%cl% is NOT a number
return
esc::exitapp

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: RandomBoy, Theda and 267 guests