2008年1月6日日曜日

4-3:Extract an information of web page

UWSC only can extract links? NO, it can access all information of web pages.

This script visits http://www.yahoo.com and gets all text data in the page.
----------
IE = CREATEOLEOBJ("InternetExplorer.Application")
IE.visible = True
IE.navigate("http://www.yahoo.com")
REPEAT
SLEEP(0.1)
UNTIL !IE.busy AND IE.readystate = 4
NOTE = EXEC("notepad")
SENDSTR(NOTE,IE.document.body.innerText)
----------
Sample script No.006
Get script :http://sky.geocities.jp/uwsc_uwsc_uwsc/06.txt


This script visits http://www.yahoo.com and gets all html data between <body> and </body> in the page
----------
IE = CREATEOLEOBJ("InternetExplorer.Application")
IE.visible = True
IE.navigate("http://www.yahoo.com")

REPEAT
SLEEP(0.1)
UNTIL !IE.busy AND IE.readystate = 4

NOTE = EXEC("notepad")
SENDSTR(NOTE,IE.document.body.innerHTML)
----------
Sample script No.007
Get script :http://sky.geocities.jp/uwsc_uwsc_uwsc/07.txt

2008年1月5日土曜日

4-2:Extract links

A web page can contain links. If you want to get all links in a page, how do you extract it? See the properties one by one? Open the source by text and check all lines? When there are a few links, it’s very easy. But if there are hundreds of links, I wouldn’t want to think the horrible situation.

This script visits yahoo.com and extracts all links in a page and pastes it to notepad
----------
LINK = ""
IE = CREATEOLEOBJ("InternetExplorer.Application")
IE.visible = True
IE.navigate("http://www.yahoo.com")
REPEAT
SLEEP(0.1)
UNTIL !IE.busy AND IE.readystate = 4
AMOUNT = IE.document.links.length - 1
FOR A = 0 TO AMOUNT
LINK = LINK + IE.document.links[A].href + "<#CR>"
NEXT
NOTE = EXEC("notepad")
SENDSTR(NOTE,LINK)
----------
Sample script No.004
Get script :<http://sky.geocities.jp/uwsc_uwsc_uwsc/04.txt>

The script, which extracts links containing a keyword, is also available. This script visits the site and extracts links containing "www" as a keyword and pastes it to notepad.

----------
LINK = ""
IE = CREATEOLEOBJ("InternetExplorer.Application")
IE.visible = True
IE.navigate("http://www.yahoo.com")

REPEAT
SLEEP(0.1)
UNTIL !IE.busy AND IE.readystate = 4
AMOUNT = IE.document.links.length - 1
FOR A = 0 TO AMOUNT
IFB POS("www",IE.document.links[A].href) > 0
LINK = LINK + IE.document.links[A].href + "<#CR>"
ENDIF
NEXT
NOTE = EXEC("notepad")
SENDSTR(NOTE,LINK)
-----------
Sample script No.005
Get script :<http://sky.geocities.jp/uwsc_uwsc_uwsc/05.txt>

2008年1月4日金曜日

4-1.Auto Login - UWSC sample scripts


In this chapter, I’ll show you the use ways of UWSC with sample scripts. But because the explanation of UWSC hasn’t come yet, the detail of the scripts are omitted.

Auto login

Account management is one of the trouble some operation. Visit the site and enter your information every time.
If you have a couple of IDs and Passwords to login to some sites, how do you manage it? With UWSC script, many sites are signed in by one click.
http://sky.geocities.jp/uwsc_uwsc_uwsc/01.html requires ID and password.

----------

IE = CREATEOLEOBJ("InternetExplorer.Application")
IE.visible = True
IE.navigate("
http://sky.geocities.jp/uwsc_uwsc_uwsc/01.html")

REPEAT
SLEEP(0.1)
UNTIL !IE.busy AND IE.readystate = 4

IE.document.forms[0].elements[0].value = "guest"
IE.document.forms[0].elements[1].value = 1234
IE.document.forms[0].elements[2].click

----------


Sample script No.001
Get script :<http://sky.geocities.jp/uwsc_uwsc_uwsc/01.txt>


When using password and account like this script, scrambling and encoding to be unreadable are recommended. UWSC initially has a scramble function.
Installing a software that manages account and password isn’t needed no more, and because of scrambling, higher security is assured than VBscript that doesn’t have encode system
.

----------

PASS = INPUT("password is 1234")
IF PASS <> 1234 THEN EXITEXIT
IE = CREATEOLEOBJ("InternetExplorer.Application")
IE.visible = True
IE.navigate("
http://sky.geocities.jp/uwsc_uwsc_uwsc/01.html")

REPEAT
SLEEP(0.1)
UNTIL !IE.busy AND IE.readystate = 4

IE.document.forms[0].elements[0].value = "guest"
IE.document.forms[0].elements[1].value = 1234
IE.document.forms[0].elements[2].click

----------

Sample script No.002
Get script :http://sky.geocities.jp/uwsc_uwsc_uwsc/02.txt


This script requires password before starting, so only the person who knows the password can execute it.
The combination with password requires and scrambling will strongly protect your script.

----------


Y_ID = INPUT("your ID[<#DBL>guest<#DBL> is correct]")
Y_PS = INPUT("your password[<#DBL>1234<#DBL> is correct]")
IE = CREATEOLEOBJ("InternetExplorer.Application")
IE.visible = True
IE.navigate("http://sky.geocities.jp/uwsc_uwsc_uwsc/01.html")

REPEAT
SLEEP(0.1)
UNTIL !IE.busy AND IE.readystate = 4

IE.document.forms[0].elements[0].value = Y_ID
IE.document.forms[0].elements[1].value = Y_PS
IE.document.forms[0].elements[2].click

----------


Sample script No.003
Get script :http://sky.geocities.jp/uwsc_uwsc_uwsc/03.txt

This script requires ID and password after starting so you can choose the account to login.

2008年1月3日木曜日

3.UWSC

I said that let's automate your computer, but how? There are many ways and many choices for automating the computers.

With what software?

First of all, the software is needed to execute your script, record your movements, and automate the computer. There are a lot of software called macro application. But in this book, I strongly recommend to use UWSC.

What is UWSC?

UWSC is a macro software programmed by Japanese person, distributed from Japan. UWSC is a very good software to automate your jobs.

Why UWSC?

UWSC has many reasons that I recommend as a masterpiece of macro software.
UWSC is free software. You don't have to pay money for this software. And this software isn't only for Japanese; there is also English version.
UWSC is easy to use. You easily can record your movements or write scripts.
UWSC can use a simple script, so you can write and run your program. But is it hard to understand UWSC’s script? With this book, the answer is "NO". I'll teach for beginners, (off course for experts).

How to get it?

To get this free soft, visit his website.
http://www.uwsc.info/download.html
This site is written in Japanese, but you will easily find the second link.




Please click "UWSC ******* " to download the software.
It is compressed in zip. Decompress it, in suitable place. (Desktop is recommended)

What can we do with UWSC?

UWSC is able to record your pc movements and write it into the script.
And you learn how to write a script of pc manipulation to execute UWSC in this book.
UWSC covers almost of Windows field.
You can manipulate mouse and keyboard movement, window, DLL, COM , other application soft by UWSC scripts.
And UWSC has a schedule function in it self.
Without any explanations before starting, let’s see what works and movements practically can be automated in the next chapter.

2008年1月2日水曜日

2.Before start automating


What is "automate"?

Though I repeated saying, "automate", what is it? Simply say, it is to make computers doing your routine jobs.
Computer is very useful for deskwork, but there still remains troublesome works. Because, the computer system isn’t perfect any time, and that often forces you to do same works, bother deskwork, routine jobs.
If you automate these works, you have a lot of benefits.
Though how? Although it is seemed very difficult to automate Windows, the reality is just simple. You write down those bother works or movements into a script and execute it. Your computers automatically do your bother works according to the script which you wrote.

Need "automate"?

Toward the question that there is a need of automating computers, I do think "YES, there is". Do you want to repeat every day in the office, in front of your computer, to click same place, enter a same words, do a series of same processes, or access same web sites every 1 hour to get a data?
I strongly recommend you to automate these bother jobs without doubt.

What works should we automate?

What are bother jobs concretely? These vary from person to person.
For example, when you repeatedly have to post the same report of your works on your company's message board(BBS), do you run a browser, visit the BBS, fill the forms, and click "send" button every time?
With macro, all can be realized by 1 click.
For example, when you have to make same files but it's names or contents are all bit different, do you make it or rename it one by one? Do you install software only to generate similar files or change the name of files?
When you have to make a graph or a report in your work every day, isn't it troublesome to visit a same web sites or to read a mail where some parts; date, title, number are changed every time.
These also can be realized by 1 click with macro.
Even the data are always different, if the way of doing is fixed, macro can help you. And not only these things, with your imagination, there are many ways of uses.
Except creative works; writing an original sentence, composing a music or drawing a picture, almost of computer jobs can be automated.

What can we get from automating?

Automating Windows must give you benefits..
Firstly you can save the time. Automated computers run very quickly without useless movements.
And you are liberated from the tired repeating works. Programmed works have sureness, so you don't have to do hundreds times of copy & paste or click no more.
That's all? No. While computer run automatically and do your jobs, you can do other creative works. Finally, automation of computers doesn’t help only you but also your friends, coworker or other persons. Those scripts can be run anywhere, if the soft is installed in the computer.

2008年1月1日火曜日

1.Preface

"Computers", "Internet", "online", these words become very popular in all over the world, because there are computers in a school, in a company, in your private place.
They are very useful and make our environment richer, and that is the reason why they are around every corner.
With these magical tools, you can get a result of difficult calculations (the work only you have to do is to input the numbers), you can know the latest news or events in all over the world on the spot, or you can communicate with your friends who live on distant location.
It's true that these technologies are very useful, and I have no doubt with these matters.
Although I know there are some people who don't have complete agreement with my opinion, and they say
-Computer is useful, but there are a lot of troublesome operations in desk works or in private use. Why do I have to click same place every time, input the same data, or do same series of operation everyday.
It is as if computers used me.
-Fixed forms of PC works are very tired. Why don't computers automate these processes?
I understand you too. I was frazzled when I used an application that had to repeat clicking many meaningless checkboxes or select lists and inputting same words many times before starting it.
Such a troublesome work is normal in computers, and toward the system, only we can do is crying to the technologies? No!!!
If you know how to automate computers, you are liberated from these troublesome works, because macro scripts will do bother systems or operations.
-But are scripting and programming very difficult for the beginners?
Don't worry about it. Since I know that PC automation is needed every people, I wrote this book for every people of every level.
If you know some kind of scripting or programming, you can choose the chapter, as you like, and if not, these fields are unknown for you , please start to read from the first chapter.
It is not difficult to automate the computer, and if you succeed to automate it, you receive many benefits.
Scripting a few minutes, automating forever. That’s not a dream.