Code: Select all
var1 := "UrlDownloadToFile, %Link%, C:\Users\%A_Username%\AppData\Local\Temp\%FileName%"
var2 := "Run, C:\Users\%A_Username%\AppData\Local\Temp\%FileName%"
Start:
Msgbox %var1%
Msgbox %var2%
Code: Select all
var1 := "UrlDownloadToFile, %Link%, C:\Users\%A_Username%\AppData\Local\Temp\%FileName%"
var2 := "Run, C:\Users\%A_Username%\AppData\Local\Temp\%FileName%"
Start:
Msgbox %var1%
Msgbox %var2%
Code: Select all
var1 := "UrlDownloadToFile, " Link ", C:\Users\" A_Username "\AppData\Local\Temp\" FileName
var2 := "Run, C:\Users\" A_Username "\AppData\Local\Temp\" FileName
Code: Select all
Filename:= "Arrays.jpg"
Link:= "https://en.wikipedia.org/wiki/File:Modern_AutoHotkey_Logo_(no_text).svg"
User:= A_Username ; Abbreviate a variable name to make it friendlier
Dir_temp:= "C:\Users\" User "\AppData\Local\Temp\"
var1 := "UrlDownloadToFile: " Link " C:\Users\" A_Username "\AppData\Local\Temp\" FileName ;a command in a variable can only be saved as text
var2 := Dir_Temp FileName ; Chain two variables
Msgbox %var1%
Msgbox %var2%
Run, %var2% ; this line will not be fulfilled, because the graphic "var2" does not exist in the system temporary directory
UrlDownloadToFile, %Link%, html_page.svg ; will download the image linked to the "link" variable
Code: Select all
Gui, Add, Text, x12 y9 w320 h30 , Downloader
Gui, Add, Edit, x12 y59 w320 h30 vLink
Gui, Add, Edit, x12 y109 w320 h30 vFileName
Gui, Add, Text, x12 y39 w320 h20 , Direct Download Link:
Gui, Add, Text, x12 y89 w320 h20 , File Name
Gui, Add, Button, x12 y139 w320 h30 gStart, Build
Gui, Show, x492 y191 h186 w349, Downloader
Return
Gui, Submit
var1 := "UrlDownloadToFile, %Link%, C:\Users\%A_Username%\AppData\Local\Temp\%FileName%"
var2 := "Run, C:\Users\%A_Username%\AppData\Local\Temp\%FileName%"
Start:
Msgbox %var1%
Msgbox %var2%
Sleep, 1000
FileAppend, %var1%, %A_WorkingDir%\build.tmp
Sleep, 1000
FileAppend, %var2%, build.tmp
Sleep, 1000
FileMove, %A_WorkingDir%\build.tmp, %A_WorkingDir%\build.ahk
Sleep, 1000
Msgbox, Done!
Return
GuiClose:
ExitApp