##
Advanced Topics

Using File Control

File Control is an advanced method of managing files on your computer on the fly between agenda steps. It allows:

- Copying a file to a new directory or directory+filename
- Moving a file to a new directory or directory+filename
- Renaming a file
- Deleting an existing file

Important Note:

Wildcards are not allowed in any of the above file functions.

Source

: The source file (file to be copied/moved/renamed or deleted)

Destination

: The destination directory or directory+filename for this file operation. For a Delete function, leave this blank.

Copying a file example

Source: The existing file you want copied elsewhere (c:\temp\lawyer.doc)
Destination: Can be the destination directory, without a trailing backslash (d:\wpdoc), or the destination directory with a filename (d:\wpdoc\lawyer2.doc)

Moving a file example

Source:

The existing file you want moved elsewhere (c:\temp\lawyer.doc)
Destination: Can be the destination directory, without a trailing backslash (d:\wpdoc), or the destination directory with a filename (d:\wpdoc\lawyer2.doc)

Important Note:

The Source file will always be deleted after a move.

Renaming a file example

Source:

The existing file you want renamed (c:\temp\lawyer.doc)
Destination: The new filename with no directory (lawyer2.doc)

Important Note:

You cannot rename a file to its original name (rename lawyer.doc to lawyer.doc, for example).

Deleting a file example

Source:

The file you want deleted (c:\temp\lawyer.doc)
Destination: Leave this blank

Example uses for File Control

Let's walk through a some scenerios for how you can use File Control to make your life much easier:

Problem: Everyday, I download a custom weather map from a site, but AutoWinNet95 renames it to map1.gif, map2.gif, etc. I want a meaningful name, so I can tell what day the weather map is.
Solution: Use a File Control step after the download. Simply do a move of the map, and specify map%DATE%.gif as the destination filename. Now you'll have map02.11.1998.gif, instead of a random name.

Problem

: I want to download a document from my friend's business, then re-upload it to another friend's FTP site. Only problem is the filename never changes, so I need it renamed before uploading. Otherwise, the old file I uploaded yesterday gets replaced.
Solution: Use a File Control step between the download and upload. Simply do a rename of the file.

Web CGI Command Posting

When visiting a web site, there's always a button to press or something to type in.
Let's take the popular Yahoo search engine for instance.
Click here to load it.

At the top, you can type in a search string like dogs and get web page links for thousands or fellow dog lovers like yourself, or type in your zip code at the bottom and press Enter Zip Code button to get some great info on your town!

These handy functions are not performed by magicians obviously.
Instead, when you press that button a program is run on Yahoo's Internet Web server that searches a database and finds the matching information you requested. Then Yahoo's program formats a web page designed specifically around your info, and spits it into your web browser.

Kinda cool, huh?

What if you could emulate that somehow? Automated web button pressing - but not limited to cute things like doing a web search, instead maybe monitoring your favorite stocks, or getting breaking news from a variety of sites instantaneously?

Well AutoWinNet can do those things, plus more! Using CGI Web Commands, you have the power to visit sites and click just about any button and produce a result, then save your formatted web page locally for later perusal.

Location
The web site address, followed by a path and where their CGI program is located. CGI programs normally end in a .EXE and are located in a /cgi-bin type directory, although some sites just use directories.

- http://www.microsoft.com/cgi-bin/websrch.exe
- http://www.excite.com/cgi-bin/birthday.exe
- http://www.monster.com/jobsearch

Parameters
The parameters sent to their CGI program. When a CGI runs on their web server, it needs the topic you're searching for, or your zip code, etc. For example when typing in dogs, your web browser will send up a SEARCH=dogs string. The CGI then scans its database for any web pages containing hounds.

Most of the time, this is a name=value pair. The first name=value has nothing in front, but following pairs will have an ampersand before it: NAME=VALUE&NAME=VALUE&NAME=VALUE ...

Save Output As
After the CGI program finishes running on their server, it spits out a resulting web page. This may have your search results, whatever stock quotes you wanted, etc.

Example #1: Product Research
Let's tackle an example: Dejanews - one of my favorite sites. Click here to open it. Dejanews is a repository for Usenet posting from all over the world. Whenever an Internet user voices their opinion on a subject, Dejanews records it and saves that info for later browsing.
I find the site useful for product research. Similar to Consumer Reports, if anyone has a gripe about Kenmore brand microwaves, Bose speakers, whatever, they'll bitch and moan about it on Usenet.

So let's schedule a Dejanews search for Kenmore Dishwashers using AutoWinNet:

- Go ahead and create a new agenda, then a Post CGI Web Command step.
- Our location is: http://search.dejanews.com/dnquery.xp
- Our parameters are: query=kenmore dishwasher&defaultOp="AND"&svcclass=dncurrent&maxhits=60&nofilt=1
- Our Save Output As will be: c:\kenmore.html

Now run it, and you receive a kenmore.html file in your c: root directory. Go ahead and view it - there's your search results for my favorite dishwasher.

Example #2: Page a friend
Another example: Page a friend and tell him to call you at work

MobileComm is a popular paging company. Click here to visit their site.
Assume you need to page a buddy and tell him where you're at, the automated style. Or send a reminder page right before 3pm reminding you to pick up flowers for your anniversary.

So let's schedule a page using MobileComm via AutoWinNet. Assuming your pager pin number is 12345:

- Go ahead and create a new agenda, then a Post CGI Web Command step.
- Our location is: http://www.mobilecomm.com/cgi-bin/wwwpage.exe
- Our parameters are: PIN=12345&MSG=Remember to grab some flowers!&Q=2
- Our Save Output As will be: c:\flower page.html

Now run it, and you receive a c:\flower page.html which just contains a confirmation message of Page was sent.

How to Steal Parameters in two easy steps

To gather those pesky parameters, you need to view the source of whatever web page you're on. Simply right click on the page, and choose View Source from the menu.
In the middle somewhere, locate the words method=POST. If you cannot find it, then posting to this CGI program is not possible.

Example Source Snippet from E-Trade site:

> FORM METHOD=POST
> ACTION=/cgi-bin/gx.cgi/AppLogic+ResearchSymbol>
> INPUT NAME="GXHC_VCODE" TYPE="HIDDEN" VALUE="W" >
> input type=hidden name=INFOTYPE value=DET_QUOTES>
> input type=text name=research_quote_symbol size=5 value="">

Now since we're already at http://www.etrade.com, we will be appending the ACTION variable to the end of our site: http://www.etrade.com/cgi-bin/gx.cgi/AppLogic+ResearchSymbol

Next, add the parameters by name.

- INPUT NAME="GXHC_VCODE" TYPE="HIDDEN" VALUE="W" translates into GXHC_VCODE=W
- input type=hidden name=INFOTYPE value=DET_QUOTES translates into INFOTYPE=DET_QUOTES
- And finally input type=text name=research_quote_symbol size=5 value="" translates into research_quote_symbol=geek

Note: I inserted my stock symbol behind symbol=

Put them all together and we have our parameters: GXHC_VCODE=W&INFOTYPE=DET_QUOTES&research_quote_symbol=geek

See how easy that works?
But let me repeat: If you're completely lost, and have no clue what HTML code looks like, then you probably don't need the CGI Posting feature. This is for intermediate to advanced users, and will stump web beginners.