Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HTML Focus and settext
#1
Hello.

I will make this short and sweet. I'm on an art website and when I leave the website, I would like a Macro or Function to post a comment on my profile every 30 minutes, ( saying what I want really )

I'm asking if anyone can present me an example. The website that I'm apart of is DeviantART.com.

On a users profile, you have a comments section. I want to be able to run a macro/function that will refresh the page every 30 minutes, focus to the chat comment section and set a text ( for example: I'll be on in 5 hours my friends ) and then finally post it and again wait another 30 minutes before it posts the same thing.

I hope I made this clear. I am now trying work in the HTML field and this is very exciting. OK, right.. thanks and I hope someone will be able to help me.
#2
I've tried numerous ways using the HTML codes but I can't figure this out without an example I can use as a reference.
Is this the only website that I can go to for help with QM ?

Thanks.
#3
Why is nobody answering? Am I invisible or something? I need help with my problem.

Please can someone show or give me an example to what I asked for..?

Can someone show me where I can download html examples so I can use them as references.

Hello ?

I'm also afraid now to buy a license if I am not going to get help. Visual Studio helps me all the time.
#4
Want to use HTML elements to automate Internet Explorer? Start from dialogs "Find HTML element" and "HTML element actions".

Quote:Is this the only website that I can go to for help with QM ?
Yes.
#5
Thank you, sir.

I use Opera as my gateway to use the internet. May I ask if there are any examples that of which, contain html examples. I would like to use it as a base reference point.
#6
Supported web browsers are only Internet Explorer, Firefox and Chrome.
Web browser automation examples exist scattered in this forum, need to search. But probably not exactly for what you described.
#7
OK. I guess I will have to use chrome for my purposes. I have looked but I can't find any html examples. Well, none that I can download. Are there any downloadable examples?

Thank you ahead of time.
#8
HTML elements are supported only in Internet Explorer. In Chrome and Firefox - only accessible objects. Quite similar. To create code, start from dialogs "Find accessible object" and "Accessible object actions". You can find many examples with accessible objects in this forum. Search for Acc.
#9
A very basic example shown in two seperate examples.
Example 1:
run chrome and go to google search page, type "test0" and then press 'ENTER' to display search results

Example 2:
Cycle/iterate/loop/repeat it 1000000 times
type "test0" presses 'ENTER' then deletes "test0" from searchbox and types "test1" presses 'ENTER' then deletes "test1" etc...etc...

My apologies for spelling errors and messed up layout regarding the green comments in the code.
Open a new macro then copy and paste it in you QM editor, in the OUTPUT window below you might see a blue link stating:
"Click here to correct the pasted code"
Immediately after pasting the code click it, and it will correct the tabbing in a more human readable friendly format.

I do not know your experience level, so I explained as thorough I could.
My code may not be optimal, it is just one way to do it.
And I am not near as good as the other users here, so If my code makes your eyes (and stomach) cringe, please chime in Big Grin

The code below will not solve your problem but it might give you a start.

EXAMPLE 1:

Macro Macro38
Code:
Copy      Help
;The below 2 variables are needed for the line directly below the 2 declared vairables (where we start chrome and go the desired page)
;you can disregard these 2 containers if you do not want to use the line where we run chrome (see below NOTE (0))
;CHANGE THE variables espacially "path_to_chrome" to the location of your chrome installation
str path_to_chrome="F:\portableapps\GoogleChromePortable\GoogleChromePortable.exe"
str url_to_open="https://www.google.com"
;
;run path_to_chrome url_to_open ;; NOTE(0): Activate this line line if you want to run the browser and open the desired url. (To activate right click in the gutter where you see line number, exactly at this line)

;If you do not activate the above line, we assume chrome is open and is at the google search page!

;______________________________________________
;
;PART 1
;------

;First run chrome and then set it at the desired position and size it as preferred, then do the below steps

;1) In your Quick Macros editor toolbar at the top right, you see the following icons:
;;;;hand/tablet-icon, keyboard-icon, mouse-icon, round wait/loading/processing-icon, window-icon, yellow folder withm agnifying glass-icon, ....etc...
;;;;The below code is generated using the 'windows' icon, from the left the 5th icon (if you hover over it, it will display a tooltip: "Windows Controls"
;2) Click on that icon, a menu appears  choose: "Window/Control actions" (second menu item from the top)
;;;;It will open a small dialog window called "Window"

;3) In the small dialog window "Window" click "Move, resize" at the left (where you see a list: "Activate or set focus" , "Close" , ...etc...)
;,After you clicked "Move, resize" click "Move and resize" somehwere in the middle of the dialog window "Window" where you see: "Move", "Resize" and "Move and resize"

;4) then click AND hold the purple square "Drag" icon and drag it OVER the chrome window
;,youu'll see that the "X,Y" inputfields AND "Width, Height" inputfields are filled in, press "OK"

;5) the code below should be generated

int w=win("Google" "Chrome_WidgetWin_1")
mov+ 10 15 800 600 w
;
;NOTE (1): originally the "int w=win(...)"  line was like this:
;int w=win("Google - Google Chrome" "Chrome_WidgetWin_1")
;I changed it like you see above, it will now target ANY "chrome" window which contains "Google"
;
;______________________________________________

;PART 2
;------

;Now we are going to input "test0"
;1) At 'Part 1' step 1, we clicked the "window", click it again a menu appears now select "Accessible object actions"
;;;;it´s the 5th item from the top.
;2) A dialog appears called "Accesiible object", at the left side select "Mouse actions" (where you see: "Do default action" , "Select", etc...)
;;;;After that select "Left click" where you see "Mouse move to" , "Left click", "Right click",.....etc...
;;;;select "Left click"
;3) Then click and drag the square purple "Drag" icon over google chrome, exactly over the search box
;4) Another bigger dialog window appears, which seams rather complex.
;;;;At the top you will something like this:
;;;;win("Google - Google Chrome" "Chrome_WidgetWin_1")
;;;;You can leave it like that or change to
;;;;win("Google" "Chrome_WidgetWin_1") ,  see "NOTE (1)"
;5) Check if "COMBOBOX" is selected at very top left where you see "Role"
;;;;Then click "OK", you'll go back the dialog "Accisble Object" window
;;;;You'll probably notice it seems that nothing changed and got auto filled in.
;;;;But if you look at the top you see something like "int w2=wait...."
;;;;click "OK" in the dialog window "Accisble object"

int w2=wait(3 WV win("Google" "Chrome_WidgetWin_1"))
Acc a.Find(w2 "COMBOBOX" "Search" "" 0x3001 3)
a.Mouse(1)

;______________________________________________

;PART 3
;------

;1) At the top right in the Quick Macros window you see a toolbar click the FIRST icon  (hand icon holding pen, when you hover over it a tooltip appears: "Text"
;2) At the bottom left you'll see "Send Keys" is selected (if not, then select it)
;;;;Type "test0" in the large white empty inputfield then click "OK"
;3) The below code should appear

key "test0"


;After the text is entered in the search box, we press enter
;;1) At the top right in the Quick Macros window you see a toolbar click the SECOND icon  (keyboard icond, when you hover over it a tooltip appears: "Keys"
;;2) A dialog window appears called "Keys" click on the button "Enter" (found somwhere at the center of dialog window)
,;You'll see 'Y' appear at the top, those are KEY CODES. (for more info click the "Info..." button, then select "QM key codes")
;;;;;When you see the 'Y' icon you can click "OK"

key Y           ;; ENTER

;NOTE (2), normally you could also use the method described in 'PART 2' to click the 'Google search' button
;(in stead of dragging over the searchbox you would drag over the desired button! the rest is exactly the same!)
;BUT I did not use this method because of two reasons:
;reason 1 (MOST IMPORTANT): Often when you input text in the searchbox the complete page changes! (search button dissapears!)
;reason 2 Pressing "Enter" is quicker then doing 'PART 2'


;RUN THIS MACRO!
;See what happens, then move to the next explanation where we are going to repeat this
;(if you did not activate line 8, make sure chrome is running and is on the google page)

EXAMPLE 2:

Macro Macro39
Code:
Copy      Help
;- THIS EXAMPLE TYPES "test0" presses 'ENTER' then deletes "test0" from searchbox and types "test1" presses 'ENTER' then deletes "test1" etc...etc...
;- MAKE SURE CHROME IS OPENED AND IN THE GOOGLE SEARCH PAGE (IF YOU DID NOT ACTIVATE LINE 10)
;- PRESS [PAUSE BREAK] to stop this macro when you want to stop it

;The below 2 variables are needed for the line directly below the 2 declared vairables (where we start chrome and go the desired page)
;you can disregard these 2 containers if you do not want to use the line where we run chrome (see below NOTE (0))
;CHANGE THE variables espacially "path_to_chrome" to the location of your chrome installation
str path_to_chrome="F:\portableapps\GoogleChromePortable\GoogleChromePortable.exe"
str url_to_open="https://www.google.com"
;
;run path_to_chrome url_to_open ;; NOTE(0): Activate this line line if you want to run the browser and open the desired url. (To activate right click in the gutter where you see line number, exactly at this line)

int i ;; declare an integer we use to cycle (repeat)

int w=win("Google" "Chrome_WidgetWin_1")
mov+ 10 15 800 600 w

for i 0 100000000 ;; An extremely large number, we just cycle this on and on '100000000' times use [PAUSE BREAK] to stop the macro...
,2 ;; this waits for 2 seconds
,
,if(i=0) ;; At the first cycle we are the normal google page. But at the next cycles (1 and above) the page is different
,,int w2=wait(3 WV win("Google" "Chrome_WidgetWin_1"))
,,Acc a.Find(w2 "COMBOBOX" "Search" "" 0x3001 3)
,,a.Mouse(1)
,,
,if(i>0) ;; If we are at a cycle higher then zero the page has probably changed!, we click in the searchbox which is displayed ABOVE the search results of the previous cycle
,,
,,int w1=wait(3 WV win("Google" "Chrome_WidgetWin_1")) ;; Sea previous example 'PART 2' This is slightly changed normally we removed the title of the search result.
,,Acc a1.Find(w1 "div" "" "a:id=inner-editor" 0x3004 3)
,,a1.Mouse(1)
,,
,,;; VERY IMPORTANT, delete the contents of which are in the searchbox!
,,;; See previous example 'PART 3' where we press 'Enter' (it is possible to press key combinations!)
,,key Ca          ;; CTRL+A
,,key X           ;; DELETE
,,
,,
,key F"test{i}" ;; Slightly changed, 'i' contains a numeric value which represents the 'cycle/loop/iteration' number (0, 1, 2...etc..) so this line would type "test0", "test1", etc... (the 'F' makes it possible to insert variables into a string, it must be enclosed in CURLY BRACES!)
,key Y           ;; ENTER
#10
Thank you so much for this! I know it's been over a year since I've been on here but saying thanks is better late then never! I will work on this and report my file if I need any more assistance. Again, thank you!

-O


Forum Jump:


Users browsing this thread: 1 Guest(s)