It's fairly simple.
I'd like to create a shortcut which:
1) Downloads a .ahk script from a website URL. (This script will change. It needs to get the latest version.)
2) Runs the script right away.
UrlDownloadToFile can download a file locally.
#Include can include the file in the script.
And Reload can restart the current script.
Of course, the best solution so far requires the use of multiple hotkeys. One to download and reload, and a second to run the script itself once it's downloaded.
Does anyone have any ideas how this could be done in one hotkey?
The script that's run could have this in it. (launcher.ahk)
URLDownloadToFile, http://example.org/script.ahk, script.ahk
FileDelete timesince.dat
FileAppend, %A_Now%
Run script.ahk
In the top of script.ahk
FileRead, old_time, timesince.dat
If (!old_time) or (A_Now - old_time >= 10000) ; Expire in one hour minutes
{
Run launcher.ahk
ExitApp
}
; Actual code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With