Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Recognizing Website?
#1

I was wondering if it was possible to set a macro to trigger once I go to a certain website, rather then triggering by the name of the window?
Taking on Quick Macros one day at a time
#2

I would try an Accessible object Trigger.
#3

Alright i'll read up on it... Never really worked with Accesible objects, if this isn't possible maybe this should be under the wish list.
Taking on Quick Macros one day at a time
#4

Hmm, this Accesible Object just isn't working out for me. I don't know if it's because im not sure what im doing or if it just won't work? Any ideas for how this would work would be great.
Taking on Quick Macros one day at a time
#5

This works for me, Keep in mind that im using Internet Explorer 7. I read http://www.quickmacros.com/help/QM_Help/...G_ACC.html to help me on the trigger.


Function ( hi_QM ) Trigger ( $a 142 -4 0 "Edit" 41477 "" "IEFrame" "Internet Explorer" 0 )
Code:
Copy      Help
function hwnd idObject idChild
;Acc a.ObjectFromEvent(hwnd idObject idChild)
str WWW.getwintext(hwnd)
out WWW

OR

Function ( hi_QM ) Trigger ( $a 142 -4 0 "Edit" 41477 "quickmacros.com" "IEFrame" "Internet Explorer" 0 )
Code:
Copy      Help
function hwnd idObject idChild
;Acc a.ObjectFromEvent(hwnd idObject idChild)
str WWW.getwintext(hwnd)
out WWW


Code:
Copy      Help
To discover events and object properties, use accessible object event logging. Right click the output pane and check Log -> Acc. events in the menu. In the logging options dialog you can specify certain filters, to exclude some types of events and objects. Following events are always excluded: LOCATIONCHANGE where idObject is CURSOR, console events, and events in QM thread. Triggers in QM thread also don't work.



For each event, in the output is displayed indexed string that has this format:

i. event, idObject, idChild

    ow: object window class, id and text

    pw: top-level parent window class and name

    ao: accessible object properties



Properties that cannot be retrieved are not displayed. For example, if the object window is top-level window, it does not have parent window, and pw line is not displayed. In the Properties dialog, leave corresponding fields empty.
#6

Thanks. I hope this works. I'll give the logging a try and see what I get.
Taking on Quick Macros one day at a time
#7

You want to look for something like this.


Code:
Copy      Help
40. VALUECHANGE, CLIENT, 0
    ow: class="Edit", id=41477, text="www.something.com"
    pw: class="IEFrame", name="Internet Explorer"

this line is not needed for the trigger you want.
    ao: role=TEXT, state=0x100000, name="Address", value="http://www.quickmacros.com/"
#8
Quote:You want to look for something like this.


Code:
40. VALUECHANGE, CLIENT, 0
ow: class="Edit", id=41477, text="www.something.com"
pw: class="IEFrame", name="Internet Explorer"

this line is not needed for the trigger you want.
ao: role=TEXT, state=0x100000, name="Address", value="http://www.quickmacros.com/"


Thats what I grabbed from it but it kept constantly, no matter where I was on the QM website, entering my password



Hmm, I tried the logging and when I put the trigger in, it doesn't seem to go by the website but instead by the title of the page at the top of Internet Explorer. I'm just trying to set it up so that when I go to a specific webpage that it will automatically enter my password. Maybe there is a better way to go about this? I'm testing it with Quick Macros website for login but I can't seem to get it to work.



.
Taking on Quick Macros one day at a time
#9

what internet explorer are you using.
#10

I believe Internet Explorer 7.
Taking on Quick Macros one day at a time
#11
in this trigger you will see quickmacros.com change that to the site your wanting.
Function ( hi_QM ) Trigger ( $a 142 -4 0 "Edit" 41477 "quickmacros.com" "IEFrame" "Internet Explorer" 0 )
Code:
Copy      Help
function hwnd idObject idChild
;Acc a.ObjectFromEvent(hwnd idObject idChild)
str WWW.getwintext(hwnd)
out WWW


if you give me the site you are wanting to put in password for i could help you.
#12

Example for QM forum.

Function ( hi_QM ) Trigger ( $a 142 -4 0 "Edit" 41477 "http://www.quickmacros.com/forum/index.php" "IEFrame" "Internet Explorer" 0 )
Code:
Copy      Help
function hwnd
int Phwnd cnt;Htm el XX1 XX2
Phwnd=GetAncestor(hwnd 2);; gets parent handle

;a1
;zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

XX1=htm("INPUT" "username" "" Phwnd 0 4 0x221)
err
,0.1
,cnt+1;if cnt=40;end ;; this will wait for the username input for 4 seconds
;soft ends if it doesnt find username input

,goto a1
XX1.SetText("YOURNAME");; your username in ""
;zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

XX2=htm("INPUT" "password" "" Phwnd 0 5 0x221)
XX2.SetText("YOURPASSWORD");; your password in ""
;zzzzzz(CLICKS LOGIN)zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

el=htm("INPUT" "Log in" "" Phwnd 0 7 0x421)
el.Click
#13

The website i'm using is for my school, to check my grades and what not... i got the trigger to work now but when it comes to the entering the password, I have no id to go by. I tried using Find Accesible Objects to get it to do the action that way but I can't get it to work.
Taking on Quick Macros one day at a time
#14

Use "HTML element actions" like in my Example.

[Image: 6gsqdkh.jpg]
#15

I tried your example but it doesnt do anything when I try it. Maybe because i'm only running on QM 2.1.8?
Taking on Quick Macros one day at a time
#16

Nevermind I got it. I needed el.SetFocus to get it to work. Thanks for all the help.
Taking on Quick Macros one day at a time
#17

No problem glad you got it.
#18
I thought this was working but now that I got the password part down now i realized that the website part isn't working. It's still entering my password at every screen with the websites name in it rather then specifically just that website.


Also, when logging, I get something like this back(This is from your earlier post):


40. VALUECHANGE, CLIENT, 0
ow: class="Edit", id=41477, text="www.something.com"
pw: class="IEFrame", name="Internet Explorer"

this line is not needed for the trigger you want.
ao: role=TEXT, state=0x100000, name="Address", value="http://www.quickmacros.com/"


Do I just choose:

"Edit", id=41477, text="www.something.com"


or


"IEFrame", name="Internet Explorer"


and then place it into the trigger?

I was choosing the top one for my website, for the trigger, and it's working, but it's triggering for every window that has at least that web address in it.


Example:
My macro would trigger with both of these web addresses:

http://www.quickmacros.com

and

http://www.quickmacros.com/forum/index.php
Taking on Quick Macros one day at a time
#19

You are going to have to use htm like in my example to enter your password or user name. This way if the id "username" is not there it will not set any text it will simple end.

I could write the code for you if you gave me the website, but im not going to be of much help otherwise. Every site is a little different there for my example is not going to work unless you make some changes to it.
#20

Okay i'll give it a try and if I can't get it to work ill post the website... I just like to try and learn how to do this stuff on my own until i'm positive I can't get it.
Taking on Quick Macros one day at a time
#21

I understand, let me know how it goes.
#22

Okay, you were right, all I had to do was add another htm for the user login so that when it doesn't see the user login that it will end the macro. Thank you for all your help.
Taking on Quick Macros one day at a time
#23

Hey any idea why the macro icon in my taskbar stays red after it types in the password? I even tried to use shutdown in the bottom of my macro to make sure it ends there but it still stays red?
Taking on Quick Macros one day at a time
#24

My guess would be that its getting hung up in a wait for something. Can you post the code?
#25
Yeah, but ill have to edit it some, because it has password and information in there and what not.
Taking on Quick Macros one day at a time
#26

Here, I just changed the a and b variable information.


Macro ( Student Connect ) Trigger ( $a 142 -4 0 "Edit" 41477 "zangleweb.resa.net/Gibraltar/StudentConnect/" )
Code:
Copy      Help
str s="0"
str b="1"
Htm el=htm("INPUT" "stuident" "" win("Zangle StudentConnection - Microsoft Internet Explorer" "IEFrame") 0 0 0x121 60)
err
,end
el.SetFocus
el.SetText(s)
0.1
Htm ell=htm("INPUT" "stupassword" "" win("Zangle StudentConnection - Microsoft Internet Explorer" "IEFrame") 0 1 0x121)
ell.SetFocus
ell.SetText(b)
Htm el3=htm("INPUT" "submit1" "" win("Zangle StudentConnection - Microsoft Internet Explorer" "IEFrame") 0 2 0x121)
el3.Click
Taking on Quick Macros one day at a time
#27
Use deb or out to see where it stops. Possibly in el.Click. If so, replace it with el.Mouse(1). I think, el.Click waits until the browser processes the click event, and sometimes it can wait really long time.

Or instead of el.Click press Enter (key Y). Or instead of all use AutoPassword.
#28

Try this it works for me other than it wont let me log in because the username and password are 0 1.

Maybe the .SetFocus is hanginig you up some how, its not needed to use .SetText .


Function ( Function4 ) Trigger ( $a 142 -4 0 "Edit" 41477 "zangleweb.resa.net/Gibraltar/StudentConnect/" )
Code:
Copy      Help
function hwnd
int Phwnd;Htm el ell el3
Phwnd=GetAncestor(hwnd 2);; gets parent handle


str s="0"
str b="1"
el=htm("INPUT" "stuident" "" Phwnd 0 0 0x121 60)
err
,out 1
,end
el.SetText(s)

ell=htm("INPUT" "stupassword" "" Phwnd 0 1 0x121)
ell.SetText(b)

el3=htm("INPUT" "submit1" "" Phwnd 0 2 0x121)
el3.Click
#29

You know what, I see the problem now you are waiting 60 seconds for "stuident" in a macro you should change this macro to a function so it doesnt keep your arrows red all the time you are surffing that website. Or change that wait time to something smaller.


Code:
Copy      Help
el=htm("INPUT" "stuident" "" Phwnd 0 0 0x121 60)


Or something like this.

Function ( Function4 ) Trigger ( $a 142 -4 0 "Edit" 41477 "zangleweb.resa.net/Gibraltar/StudentConnect/" )
Code:
Copy      Help
function hwnd
int Phwnd;Htm el ell el3
Phwnd=GetAncestor(hwnd 2);; gets parent handle
;wait until fully loads

wait 0 I

str s="0"
str b="1"
el=htm("INPUT" "stuident" "" Phwnd 0 0 0x121);; NO need for the wait time now.
err
,out "NOT LOGIN PAGE."
,end
el.SetText(s)

ell=htm("INPUT" "stupassword" "" Phwnd 0 1 0x121)
ell.SetText(b)

el3=htm("INPUT" "submit1" "" Phwnd 0 2 0x121)
el3.Click
#30

Thank you very much, that did it.
Taking on Quick Macros one day at a time


Forum Jump:


Users browsing this thread: 1 Guest(s)