click on a field of active window by id with an autohotkey like (for example) /6.3.1/

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
pradipsinhhada
Posts: 8
Joined: 14 Jun 2018, 07:48

click on a field of active window by id with an autohotkey like (for example) /6.3.1/

05 Sep 2018, 02:44

i want to login a website (that is government portal, i am government employee who wants to make his routine work easier, so please help) and reach the destined page manually, that page has 256 fields of which i have posted screenshot. all i want to do is insert in any field without using mouse, and by using numpad of the keyboard. i can get elementid of that field by 'inspect'. my dream is as below.

example 1. i want to enter "780" in the field that is of 1st column and 4th row. then i want to be able to doing it by hitting these keys : /1.4/780

similarly,
example 2. i want to enter "12.77" in the field that lies in column 6.3 and 6th row, then enter "6.33" in the field that lies in column 5.1 and 3rd raw. so, i must be able to do this by hitting keys : /6.3.6/12.77 /5.1.3/6.33 and so on ... i will have to do 50 to 60 entries at a time.
in autohotkey script i must define all 256 fields. ElementID of field 1.1 (that is 1st column and 1st row) is "elem121", similarly field 1.2 is "elem122", so i want to be able to insert that field by just entering hotkey /1.1/ and then want to enter amount, but problem is we cant make /1.1/ or /6.3.1/ a hotkey. :oops: but i am sure one of you will surely sort this out.
I HOPE YOU GOT MY POINT, PLEASE ASK IF I DIDNT MAKE IT CLEAR, I AM EAGERLY WAITING FOR YOUR RESPONSE.

how do i do this now a days?
i got a hardcopy letter from each village panchayat of its yearly account, which have 50 to 60 entries. then i mark a field name by pencil on each entry. eg. this rupees 5.6 lakhs is to be entered in field 1.1, this Rs. 5.45 lakhs is to be entered in field 6.3.1, and so on.. then i login to a perticular website and reach to a page which i have posted an image of. then find filed 6.3.1 among 256 fields buy mouse, i would scroll up-down, right-left to insert in each perticular field. that is much time consuming, if i would be able to go to that field by only typing its address in between/and/ (eg. /6.3.1/ or /1.1/) then it would be great great accomplishment :dance:

IT IS MY DREAM, PLEASE HELP ME TO MAKE IT TRUE.
Attachments
elementid.jpg
(473 KiB) Not downloaded yet
Untitled.png
(214.94 KiB) Not downloaded yet
pradipsinhhada
Posts: 8
Joined: 14 Jun 2018, 07:48

Re: click on a field of active window by id with an autohotkey like (for example) /6.3.1/

14 Sep 2018, 05:21

yes! somehow i simply did it. and its working.

but i dont know if i can use "loop" in this case
i have made this script for maximum 35 entries, but there is merely 20 entries.
MY QUESTION IS*****how to break when variable (for tab) is #N/A in excel cell?*****

(SEE THIS SCRIPT, I HAVE ALSO POSTED EXCEL FILE, BEFORE RUNNING THIS SCRIPT ACTIVE CELL MUST BE ON THE FIRST CELL UNDER "TAB"FIELD. AND THE CURSOR ON THAT WEBSITE'S FIRST FIELD OF WHICH I HAVE EARLIER POSTED IMAGE)

EXCEL FILE : https://drive.google.com/file/d/1hBFNXz ... sp=sharing

SCRIPT

^e::
XL := ComObjActive("Excel.Application") ;Create an object to the active excel window
xa := XL.activecell.Value ;store the value of a cell as a variable
ya := XL.activecell.offset(0,1).Value
send {tab %xa%}
send {right}
send {+}
send %ya%
send +{tab %xa%}
sleep 100

a := xl.activecell.offset(1,0).value
b := xl.activecell.offset(1,1).value
send {tab %a%}
send {right}
send {+}
send %b%
send +{tab %a%}
sleep 100

c := xl.activecell.offset(2,0).value
d := xl.activecell.offset(2,1).value
send {tab %c%}
send {right}
send {+}
send %d%
send +{tab %c%}
sleep 100

e := xl.activecell.offset(3,0).value
f := xl.activecell.offset(3,1).value
send {tab %e%}
send {right}
send {+}
send %f%
send +{tab %e%}
sleep 100

g := xl.activecell.offset(4,0).value
h := xl.activecell.offset(4,1).value
send {tab %g%}
send {right}
send {+}
send %h%
send +{tab %g%}
sleep 100

i := xl.activecell.offset(5,0).value
j := xl.activecell.offset(5,1).value
send {tab %i%}
send {right}
send {+}
send %j%
send +{tab %i%}
sleep 100

k := xl.activecell.offset(6,0).value
l := xl.activecell.offset(6,1).value
send {tab %k%}
send {right}
send {+}
send %l%
send +{tab %k%}
sleep 100

m := xl.activecell.offset(7,0).value
n := xl.activecell.offset(7,1).value
send {tab %m%}
send {right}
send {+}
send %n%
send +{tab %m%}
sleep 100

o := xl.activecell.offset(8,0).value
p := xl.activecell.offset(8,1).value
send {tab %o%}
send {right}
send {+}
send %p%
send +{tab %o%}
sleep 100

q := xl.activecell.offset(9,0).value
r := xl.activecell.offset(9,1).value
send {tab %q%}
send {right}
send {+}
send %r%
send +{tab %q%}
sleep 100

s := xl.activecell.offset(10,0).value
t := xl.activecell.offset(10,1).value
send {tab %s%}
send {right}
send {+}
send %t%
send +{tab %s%}
sleep 100

u := xl.activecell.offset(11,0).value
v := xl.activecell.offset(11,1).value
send {tab %u%}
send {right}
send {+}
send %v%
send +{tab %u%}
sleep 100

w := xl.activecell.offset(12,0).value
x := xl.activecell.offset(12,1).value
send {tab %w%}
send {right}
send {+}
send %x%
send +{tab %w%}
sleep 100

y := xl.activecell.offset(13,0).value
z := xl.activecell.offset(13,1).value
send {tab %y%}
send {right}
send {+}
send %z%
send +{tab %y%}
sleep 100

aa := xl.activecell.offset(14,0).value
ab := xl.activecell.offset(14,1).value
send {tab %aa%}
send {right}
send {+}
send %ab%
send +{tab %aa%}
sleep 100

ac := xl.activecell.offset(15,0).value
ad := xl.activecell.offset(15,1).value
send {tab %ac%}
send {right}
send {+}
send %ad%
send +{tab %ac%}
sleep 100

adx := xl.activecell.offset(16,0).value
ae := xl.activecell.offset(16,1).value
send {tab %adx%}
send {right}
send {+}
send %ae%
send +{tab %adx%}
sleep 100

af := xl.activecell.offset(17,0).value
ag := xl.activecell.offset(17,1).value
send {tab %af%}
send {right}
send {+}
send %ag%
send +{tab %af%}
sleep 100

ah := xl.activecell.offset(18,0).value
ai := xl.activecell.offset(18,1).value
send {tab %ah%}
send %ai%
send {right}
send {+}
send +{tab %ah%}
sleep 100

aj := xl.activecell.offset(19,0).value
ak := xl.activecell.offset(19,1).value
send {tab %aj%}
send %ak%
send {right}
send {+}
send +{tab %aj%}
sleep 100

al := xl.activecell.offset(20,0).value
am := xl.activecell.offset(20,1).value
send {tab %al%}
send {right}
send {+}
send %am%
send +{tab %al%}
sleep 100

an := xl.activecell.offset(21,0).value
ao := xl.activecell.offset(21,1).value
send {tab %an%}
send {right}
send {+}
send %ao%
send +{tab %an%}
sleep 100

ap := xl.activecell.offset(22,0).value
aq := xl.activecell.offset(22,1).value
send {tab %ap%}
send {right}
send {+}
send %aq%
send +{tab %ap%}
sleep 100

ar := xl.activecell.offset(23,0).value
as := xl.activecell.offset(23,1).value
send {tab %ar%}
send {right}
send {+}
send %as%
send +{tab %ar%}
sleep 100

at := xl.activecell.offset(24,0).value
au := xl.activecell.offset(24,1).value
send {tab %at%}
send {right}
send {+}
send %au%
send +{tab %at%}
sleep 100

av := xl.activecell.offset(25,0).value
aw := xl.activecell.offset(25,1).value
send {tab %av%}
send {right}
send {+}
send %aw%
send +{tab %av%}
sleep 100

ax := xl.activecell.offset(26,0).value
ay := xl.activecell.offset(26,1).value
send {tab %ax%}
send {right}
send {+}
send %ay%
send +{tab %ax%}
sleep 100

az := xl.activecell.offset(27,0).value
ba := xl.activecell.offset(27,1).value
send {tab %az%}
send {right}
send {+}
send %ba%
send +{tab %az%}
sleep 100

bc := xl.activecell.offset(28,0).value
bd := xl.activecell.offset(28,1).value
send {tab %bc%}
send {right}
send {+}
send %bd%
send +{tab %bc%}
sleep 100

be := xl.activecell.offset(29,0).value
bf := xl.activecell.offset(29,1).value
send {tab %be%}
send {right}
send {+}
send %bf%
send +{tab %be%}
sleep 100

bg := xl.activecell.offset(30,0).value
bh := xl.activecell.offset(30,1).value
send {tab %bg%}
send {right}
send {+}
send %bh%
send +{tab %bg%}
sleep 100

bi := xl.activecell.offset(31,0).value
bj := xl.activecell.offset(31,1).value
send {tab %bi%}
send {right}
send {+}
send %bj%
send +{tab %bi%}
sleep 100

bk := xl.activecell.offset(32,0).value
bl := xl.activecell.offset(32,1).value
send {tab %bk%}
send {right}
send {+}
send %bl%
send +{tab %bk%}
sleep 100

bm := xl.activecell.offset(33,0).value
bn := xl.activecell.offset(33,1).value
send {tab %bm%}
send {right}
send {+}
send %bn%
send +{tab %bm%}
sleep 100

bo := xl.activecell.offset(34,0).value
bp := xl.activecell.offset(34,1).value
send {tab %bo%}
send {right}
send {+}
send %bp%
send +{tab %bo%}
sleep 100

bq := xl.activecell.offset(35,0).value
br := xl.activecell.offset(35,1).value
send {tab %bq%}
send {right}
send {+}
send %br%
send +{tab %bq%}
sleep 100
return
DRocks
Posts: 565
Joined: 08 May 2018, 10:20

Re: click on a field of active window by id with an autohotkey like (for example) /6.3.1/

14 Sep 2018, 05:30

It seems interesting but i dont understand why Excel and why there is only one hotkey?

Do you trigger all these actions at once?
pradipsinhhada
Posts: 8
Joined: 14 Jun 2018, 07:48

Re: click on a field of active window by id with an autohotkey like (for example) /6.3.1/

14 Sep 2018, 06:10

DRocks wrote:It seems interesting but i dont understand why Excel and why there is only one hotkey?

Do you trigger all these actions at once?
THNX FOR CONCERN DROCKS..
PLS SEE THE VIDEO OF WHAT I DO WITH THIS HOTKEY.
https://drive.google.com/file/d/1bTIZN3 ... sp=sharing

WHY EXCEL? ANSWER: its easy to enter data in excel rather than web portal which have 256 fields and you have to find that particular field for each entry. so its easy to type field name in a excel cell, then enter value relating to that field to next cell. so it is easy to enter data on excel that direct to portal.

why there is only one hotkey? : i am new and noob to this so i cant think how many hotkey can make it more easier.
again thnx for response :)
pradipsinhhada
Posts: 8
Joined: 14 Jun 2018, 07:48

Re: click on a field of active window by id with an autohotkey like (for example) /6.3.1/

14 Sep 2018, 06:31

let me be more clear about this work.
first of all i gets this paper from a village local body authority. ( https://drive.google.com/open?id=1X8182 ... SOwAoK35Xt ). then i mark with a pencil on them (marking is visible in image) about which income or expenditure goes to which field. me and a colleague can mark them coz we had practiced it. then i enter that marking and value next to relative marking in excel sheet. (whch i have posted before : https://drive.google.com/file/d/1hBFNXz ... sp=sharing). i have done such a setting in excel that do two things (1)converts marking in to a number that defines how much time a tab key may be pressed if a cursor is at first field (2) convert values in a lakh, that simply devides it with 100000

then i do this thing which you have seen in this video earlier. https://drive.google.com/file/d/1bTIZN3 ... sp=sharing

ANY SUGGESTIONS ARE WELCOMED TO MAKE IT MORE EASIER.

ALSO PLEASE SUGGEST HOW TO STOP THIS WHEN VARIABLE (NUMBER OF TAB) IS #N/A?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, Fredrik F, maxkill, RandomBoy, ShatterCoder and 396 guests