Jump to content

Noobie question


Recommended Posts

Hi guys.

First off, I have used AutoIt 2, the "old" one for some time to do simple automating tasks. And when I need something more powerfull I use Visual Dialogscript.

And now I see there is a new version on the way. AutoIt 3.

I haven't worked much with it yet, just made a simple downloader for a project I was working on and it was only three lines of codes. So beautiful.

Anyways, I first started with, and eventually bought Visual Dialogscript ($99) because it was so easy to use and I could write very handy programs in a very short time.

Oops, got alittle off topic here. Anyways, just wanted to say to who ever writes AutoIt 2 and 3, you f*cking rule man.

It's simply amazing.

Offcourse there is alot of advanced stuff there I haven't gotten yet, but I'll learn. The old version was alot easier *lol*

Anyways, back to my problem.

The downloader I mention looks pretty much like this:

AutoItSetOption ("TrayIconHide",1)
URLDownloadToFile("http://www16.dnb.no/valuta/kursliste.csv", "kursliste.csv")

What I need to do to make this exactly the way I want is to be able to pass some information from my program, like user information, download URL and destination URL back to the autoit program.

Also, the TrayIconHide doesn't seem to work at all.

I can see the icon in my tray when I run the program.

So for this long post on such a simple question.

Anyways, again, thanks for such an amazing program :whistle:

Link to comment
Share on other sites

The Icon stays up for only .7 seconds or so. (anti hacker code)

The developers were thinking of not putting it in at all. For techie types, you can remove it completely, but you will need to compile it yourself.

As far as user info and such, you can do some of that via http.


AutoItSetOption ("TrayIconHide",1)
URLDownloadToFile("http://username:Password@www16.dnb.no/valuta/kursliste.csv", "kursliste.csv")

If they use .htaccess files, this is one format that works.

I have a few PHP pages I have custom downloads, so I use one more like:

URLDownloadToFile("http://www16.dnb.no/valuta/kursliste.php?myfile=scriptkitty", "kursliste.csv")

PhP would pass the proper page and access to me.

You can ask the user of your AutoIt file for info with the inputbox ex:

$answer = InputBox("Question", "Where were you born?", "", "", -1, -1, 0, 0)
msgbox(1,"Your answer was",$answer)

If you want to ask say what page to download, it might look like this:

$answer = InputBox("Question", "What ulr page to download?", "", "", -1, -1, 0, 0)
$destination = FileSaveDialog( "Choose destination.", "c:\", "My Files (*.htm)", 1 + 4 )
URLDownloadToFile($answer, $destination)
if @error=0 then
msgbox(1,"Error downloading",$answer)
msgbox(1,"Your file was saved as",$destination)

Or something like that.

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

oh, after re reading your post, maybe you meant you would like to pass commandline options to AutoIt, such as user info and such.

You can do this via running AutoIt scripts with commandlines.

$CmdLine[0]is number of parameters

$CmdLine[1] is param 1 (after the script name)

$CmdLine[2] is param 2 etc

run say "myscript.au3 username destination"

if $CmdLine[0]=2 then msgbox(1,"You passed ",$CmdLine[1] & @CRLF & $CmdLine[2])

just one example

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...