Jump to content

Enter spezific number and set as "count"


Recommended Posts

Hi,

I have written a small script to copy links from a website and enter them in a downloader-program.

Prior to activate the script i have already marked the first link.

-------------------------------------------------------------------------------

;~ While 1

;~ $count += 1 ; increment $count by 1 (dont know what to do here)

If Not WinActive ("Mozilla") Then WinActivate("Mozilla")

Send("{APPSKEY}")

Send("{DOWN 6}") ; copy link

Send("{ENTER}")

;~ Send("!k")

If Not WinActive ("Downloader") Then WinActivate("Downloader")

Send("^v")

If Not WinActive ("Mozilla") Then WinActivate("Mozilla")

Send("{TAB}")

;~ If $count = XXX Then ExitLoop ; Quit when you have done it xxx times

;~ WEnd

-------------------------------------------------------------------------------

Now I want to do it as many times as there are links. I want a message box which askes how many links there are and I enter the number.

Can anybody show me, how 1) the input box works and 2) how this is implemented into the count number.

I hope that it is called an input box, since I coudn't find anything in "search".

Thanks in advance.

Skolle

Link to comment
Share on other sites

Welcome to the forum.

try this

; Info entered into an input box is a string
$answer = InputBox("AutoIt", "Enter the number of links.")

; converts string to a number
$answer = Number($answer)

For $i = 1 To $answer
    If Not WinActive("Mozilla") Then WinActivate("Mozilla")
    Send("{APPSKEY}")
    Send("{DOWN 6}") ; copy link
    Send("{ENTER}")
;~ Send("!k")
    If Not WinActive("Downloader") Then WinActivate("Downloader")
    Send("^v")
    If Not WinActive("Mozilla") Then WinActivate("Mozilla")
    Send("{TAB}")
Next

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

It works,...

"Of course it does," he says arrogantly. Just kidding.

I was not sure that it would work since I could not test the code before posting it.

...thanks a lot!! :)

You are welcome.

[size="1"][font="Arial"].[u].[/u][/font][/size]

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
 Share

  • Recently Browsing   0 members

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