Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with HTM please
#1
Hi, I am new to Quick Macros programming.
Could someone post a little piece of code to do the following:
I go to a web page that has a button with the word "Continue"
and I want to click on it.
I tried this, but it does not work:

Htm el=htm("P" "Continue" "" "Internet Explorer" 0 0 0x221)
el.click

This is the source code:

<p class="ch-actions"> <input type="submit" name="_eventId_Cs" value="Continue" class="ch-btn"/>
o <a href="/sell/sell?execution=e3s1&_eventId_newList" id="newListing">New item</a></p>

Thank you very much
Reply
#2
The element must be INPUT, not P.
In the "Find htm element" dialog select the button so that tag would be INPUT. If not possible or it is not good for searching, select the P and navigate to it with the arrow buttons. Or just enter 1 in the Navigate field. Then Test. If finds wrong element, play more wit the arrows and Navigate.
Reply
#3
Thank you very much.
Reply
#4
updated:
In the "Find htm element" dialog select the button so that tag would be INPUT. If not possible or it is not good for searching, select the P and navigate to it with the arrow buttons. Or just enter 1 in the Navigate field. Then Test. If finds wrong element, play more wit the arrows and Navigate.
Reply
#5
Is there a function that retrieves the whole web page source code?
Reply
#6
Html element dialog, Get page properties.
Reply
#7
Thank you again Smile
Reply
#8
Hi, is there a programming command to close a message box, without entering key strokes or mouse strokes?
For example, if I create a MsgBoxAsync box, how can I close it?
Can I close its handle or something like that?
If so, how do I get the handle in the first place?
Thank you.
Reply
#9
Macro Macro2161
Code:
Select All      Help
MsgBoxAsync "text" "Find Me"
1
int w=win("Find Me" "#32770")
if(w) clo w
Reply
#10
Thank you Smile
Reply
#11
Hi, how could I make a progress box,
something like this but without creating a new window every time:

int i
for(i 0 5)
MsgBoxAsync i "Progress meter"

The code above would create five different boxes.
Is there a way to send text to just one box, as the loop goes by?
It does not have to be by using MsgBoxAsync,
it could be any other message box.

Thank you.
Reply
#12
With MsgBoxAsync:
Macro Macro2162
Code:
Select All      Help
MsgBoxAsync "[9][9][9][9][9][9]" "Progress meter"
int w=wait(30 WA win("Progress meter" "#32770"))
int c=child("" "Static" w)
int i
for(i 0 5)
,str s=i
,s.setwintext(c)
,0.5
clo w
Reply
#13
PS: I tab-indented the last line of my code above, but it did not take.
Reply
#14
Thank you Smile
Reply
#15
Is there a way to set the size of the MsgBoxAsync you coded above?
Reply
#16
Never mind, I got it.
Reply
#17
Maybe better use OnScreenDisplay.
Macro Macro2153
Code:
Select All      Help
int i
for(i 0 5)
,str s=i
,OnScreenDisplay s 0 0 0 "" 0 0 1|4|8 "Progress meter"
,0.5
Reply
#18
I like both examples, thank you.
Reply
#19
I am running a macro that visits web pages, checking for their content.
After visiting about 500 pages, the computer starts clogging, I get a wait error message, and the macro stops.

- If I run the macro again, it may visit just under 10 pages more.
- If I restart the computer, it may visit about 100 pages.
- if I shut down the computer, and start afresh, I get back to the 500.

The macro is set up for Internet Explorer,
however, Firefox works much faster in my computer.
I did disable everything I could in Quick Macros.
Any suggestions to improve performance,
other than using multiple computers at a time?

Thank you.
Reply
#20
Look in Task Manager, does memory usage of qm or iexplore grow when running the macro many times?
Does the function run in multiple threads simultaneously? Look in the Running Items list.
Create the macro for Firefox, if possible.
Reply
#21
I will check the CPU usage.
Thank you.
Reply
#22
> Does the function run in multiple threads simultaneously?

No, the only thing that runs is QM and IE, one instance of each.
Reply
#23
The HTML element Drag utility does not work with Firefox, correct?
Reply
#24
Correct. Use accessible objects.
Reply
#25
You are very helpful.
Reply
#26
Hi, is there a function that returns the characters 0 through 255,
something like:

str s
s = chr(34) ;; s should be a quote now
s = chr(9) ;; s should be a tab now

without resorting to:

s = " "
s[0] = 34

Thank you
Reply
#27
s.format("%C" 34)

It is slower, but supports Unicode characters.
Reply
#28
Hi, I am running a QM macro that calls a standard "Choose a file" window.
I want to paste a file name in it, but nothing works.

I tried:

Key (file name)
Paste (file name from the clipboard)
Ao (ALT O to open a file)
An (ALT N to focus on the file name box)
lef (on the file name box before pasting)
Activating that window (int w="Choose file to upload" "#32770")

The drag utility only sees the window, not the file name text box.
If I stop the macro, I can paste manually.

Any advice so the window takes the QM commands?

Thank you
Reply
#29
Quote:If I stop the macro, I can paste manually.
Pasting manually also does not work while the macro is running? Maybe the macro presses and does not release Alt or Shift key? Can you post the macro here?
Reply
#30
Hi, the macro stops by itself because my QM code does not see the "Open file window",
even if I click right on top of it with a lef command.
This is a piece of code that I inserted in a larger program that was running fine.
Even after pasting the file name manually, the rest of the code gets disrupted.
As a curiosity, the "Open file window" always opens up in a different temporary folder.

int w=wait(3 WV win("Describe tu producto - Windows Internet Explorer" "IEFrame"))

;; begins new code
Htm e=htm("INPUT" "picturesNative" "" w "0" 27 0x121 3)
out sImageUrl ;; test file name, which is a public variable
wait 3
e.Click
wait 3
int w1=win("Choose File to Upload" "#32770")
act w1
wait 5
key sImageUrl
key Ao ;; open file
wait 10
act w
;; ends new code

e=htm("INPUT" "title" "" w "0" 37 0x121 3)
e.SetText(sMercadoTitle)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)