Read one line, enter it into a webfield, read the next...

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

a2a
Newbie
Posts: 13
Joined: Fri Jul 16, 2010 5:06 pm

Post by a2a » Fri Jul 16, 2010 10:09 pm

got it, ty

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Sat Jul 17, 2010 4:19 am

i think i have gotten a wrong impression about what that screencap actually does Razz i was hoping for it to show me what the Webpage would show haha.
It does show you the first page of results. Isn't that what you are seeing?

a2a
Newbie
Posts: 13
Joined: Fri Jul 16, 2010 5:06 pm

Post by a2a » Sat Jul 17, 2010 9:53 am

adroege wrote:
i think i have gotten a wrong impression about what that screencap actually does Razz i was hoping for it to show me what the Webpage would show haha.
It does show you the first page of results. Isn't that what you are seeing?
Sorry i didnt mention, it just showes me a screen capture of my desktop :O

Edit: Using this,

GetScreenRes>sX,sY
Min>min
Sec>sec
Hour>hour

ScreenCapture>0,0,sX,sY,c:\temp\cap.%hour%.%min%.%sec%.jpg

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Sat Jul 17, 2010 6:27 pm

do you have multiple monitors, or some other weird setup?

Do you see Internet Explorer open when you run the macro script?



When I run your script, Internet Explorer is open, and captured in the screenshot.

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Sat Jul 17, 2010 6:34 pm

And to answer your other question about how to write results to a file this code works nicely.

Code: Select all

Let>page=http://www.google.com/search?h1=en&source=hp&q=
Let>searchterm=macroscheduler
Let>searchpage=%page%%searchterm%
HTTPRequest>searchpage,c:\temp\search_result.html,GET,,result
ExecuteFile>c:\temp\search_result.html
Notice that it performs a google search on the text "macroscheduler" and then writes the result to the local file "c:\temp\search_result.html"

ExecuteFile command then launches your default browser and opens that local file - showing you a live webpage just as if you had typed in the search yourself.

a2a
Newbie
Posts: 13
Joined: Fri Jul 16, 2010 5:06 pm

Post by a2a » Sat Jul 17, 2010 7:34 pm

adroege wrote:do you have multiple monitors, or some other weird setup?

Do you see Internet Explorer open when you run the macro script?



When I run your script, Internet Explorer is open, and captured in the screenshot.
The IE window never opens, so thats the reason i believe. No dual screens, no black screen, only a nice screenshot of my desktop, witch is acctually all i see when i run it aswell...

Is my code wrong, do i need to trigger it to actually open a IE window aswell?

Edit: If i make an .exe, or run the script via the scheduler, it pops up with windows according to the searchterm lines in the .txt, once per searchterm, the popup contains the searchterm.

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Sat Jul 17, 2010 8:01 pm

The sample code you used for the web stuff was generated by Web Recorder, did you install WebRecorder? The commands won't work anywhere besides the computer WebRecorder (specifically it's DLL) is installed in.

If you don't have, or want to pay for WebRecorder, it's possible to do the same stuff, only you have to code it in VBScript and put the code between VBStart> and VBEnd> blocks inside of Macro Scheduler. This is more advanced stuff - which was why WebRecorder was created to make it easier.

Here is info on WebRecorder
http://www.mjtnet.com/webrecorder.htm#

You can also get a free trial version of WebRecorder to use at this link:
http://www.mjtnet.com/dldfile.htm?file= ... ebRecorder

a2a
Newbie
Posts: 13
Joined: Fri Jul 16, 2010 5:06 pm

Post by a2a » Sat Jul 17, 2010 8:13 pm

Thanks. I got my trial version of Webrecorder. It is installed on my computer. Will reinstall now.

a2a
Newbie
Posts: 13
Joined: Fri Jul 16, 2010 5:06 pm

Post by a2a » Sat Jul 17, 2010 8:17 pm

I was also thinking of this solution;

http://www.mjtnet.com/forum/viewtopic.php?t=4660

But really unsure how to intergrate it

a2a
Newbie
Posts: 13
Joined: Fri Jul 16, 2010 5:06 pm

Post by a2a » Sat Jul 17, 2010 8:46 pm

I have now created a .exe of the script, made sure that IEAuto.dll is in the same directory, but still when i start it it shows me a dialog box with the first searchstring, i click ok, then the next etc.

So it still does not trigger IE im afraid :1

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Sat Jul 17, 2010 10:03 pm

Don't create an exe. Just run it from Macro Scheduler. This should work.

To get it to work from an exe, a subdirectory has to be created with a special name to contain the DLL. Don't remember right at this moment what the name of the folder should be -- I would have to look it up.


But running it from Macro Scheduler is all automatic. You should see Internet Explorer open up and navigate to http://www.google.com.


Option #2 -----------------------

Use the code sample I gave you with HTTPRequest. You can modify as appropriate to put this in a loop and read the search terms from a file. All the results will be saved to local files. ExecuteFile can then be called multiple times to load all the results into separate windows or tabs of your default browser.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts