topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 6:53 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: DONE: Script help request  (Read 5370 times)

Learning

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 14
    • View Profile
    • Donate to Member
DONE: Script help request
« on: January 04, 2010, 07:30 AM »
Hello all

I want to write a little script to display a message box that has a title,message and YES,NO buttons

and when the yes button is pressed the script will start downloading a program from a web link

that's all

thanks in advance

AndyM

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 616
    • View Profile
    • Donate to Member
Re: DONE: Script help request
« Reply #1 on: January 04, 2010, 09:38 AM »
Are you going to use AutoHotkey for your script?

Learning

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 14
    • View Profile
    • Donate to Member
Re: DONE: Script help request
« Reply #2 on: January 04, 2010, 09:44 AM »
Are you going to use AutoHotkey for your script?

right

wr975

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 369
    • View Profile
    • Donate to Member
Re: DONE: Script help request
« Reply #3 on: January 04, 2010, 12:05 PM »
Here are two scripts for your request.

Read the Help file for each command and try to understand what the commands are doing. I couldn't write a script without looking in the help file. :)

Something you can try: If the download is OK, check the size of the downloaded file. If smaller than let's say 50 kb, read the file in a variable and check for a "not found" string. (If the file is not found, AHK will save the 404 error page.)


msgbox, 36, This box has a title, This is a message
IfMsgBox, Yes
run,http://www.autohotkey.com/download/AutoHotkeyInstall.exe


or

msgbox, 36, This box has a title, This is a message
IfMsgBox, Yes
{
ToolTip, Downloading...
UrlDownloadToFile, http://www.autohotkey.com/download/AutoHotkeyInstall.exe, %A_scriptdir%\AutoHotkeyInstall.exe
Tooltip
if errorlevel = 1
msgbox, 16, This is another title, Download failed
else
msgbox, 64, This is another title, Download OK`n`(but can't be 100`% sure`, check AHK help file`)
}