Online text editor for use with UrlDownloadToFile Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ozzynotwood
Posts: 30
Joined: 16 Nov 2017, 19:19

Online text editor for use with UrlDownloadToFile

Post by ozzynotwood » 01 Apr 2023, 02:38

Hello!

I want to create an AHK project where AHK uses "UrlDownloadToFile" to download INI files. The idea is my script (on multiple PC's) can receive updates on INI file information without having to do manual updates on each PC. This update would be a complete file overwrite at the point of download.

Trouble is, I cant find an online text editor that will let me:
- Edit the INI file online & save it as a basic TXT file.
- Create a downloadable link, for example: www.fake-adderss.com/myupdate.ini

What I do find is editors saving files in their own format & creating links like onedrive.com/auth?343token?343%4fdf4$dsfds&dssadsd. These types of URL's don't work with "UrlDownloadToFile" & do not create errors for troubleshooting.

Does anybody know of an online editor that gives me an online editor solution compatible with "UrlDownloadToFile"?

User avatar
RDC
Posts: 112
Joined: 29 Jan 2023, 10:22

Re: Online text editor for use with UrlDownloadToFile

Post by RDC » 01 Apr 2023, 08:19

This sounded like an interesting concept to me so I had to do some digging myself. Turns out...

"UrlDownloadToFile" is a function in AutoHotkey that allows you to download a file from the internet and save it to your computer. As for an online editor that is compatible with "UrlDownloadToFile", there isn't one because "UrlDownloadToFile" is a function that is executed on the client-side, meaning it requires access to the client's file system to save the downloaded file.

Kinda sux, but at least now we know.

User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

Re: Online text editor for use with UrlDownloadToFile

Post by mikeyww » 01 Apr 2023, 08:28

I don't think that is the issue. The question is whether an online editing service hosts text files and also provides a URL for downloading the hosted files. Of course, if you have a file server, then you can just use FTP.

gregster
Posts: 9001
Joined: 30 Sep 2013, 06:48

Re: Online text editor for use with UrlDownloadToFile

Post by gregster » 01 Apr 2023, 09:01

RDC wrote:
01 Apr 2023, 08:19
This sounded like an interesting concept to me so I had to do some digging myself. Turns out...

"UrlDownloadToFile" is a function in AutoHotkey that allows you to download a file from the internet and save it to your computer. As for an online editor that is compatible with "UrlDownloadToFile", there isn't one because "UrlDownloadToFile" is a function that is executed on the client-side, meaning it requires access to the client's file system to save the downloaded file.
Where was the digging done? ChatGPT? :problem:

User avatar
RDC
Posts: 112
Joined: 29 Jan 2023, 10:22

Re: Online text editor for use with UrlDownloadToFile

Post by RDC » 01 Apr 2023, 09:10

If my response was incorrect, I apologize. Was just trying to help since I saw nobody else responding and it looked like an interesting idea.

User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

Re: Online text editor for use with UrlDownloadToFile

Post by mikeyww » 01 Apr 2023, 09:40

Unfortunately, ChatGPT spews out a lot of garbage that doesn't make a lot of sense! For example,
As for an online editor that is compatible with "UrlDownloadToFile", there isn't one because "UrlDownloadToFile" is a function that is executed on the client-side, meaning it requires access to the client's file system to save the downloaded file
Like, well, that is the point of AutoHotkey and the point of that command-- to execute on the client and to save the downloaded file. Of course, a download targets an online file. Therefore, to say that "there isn't one"-- an editor compatible with the command-- is nonsense. I don't mean that it's a bad idea or a bad practice. I mean that the concept is illogical and fails to reflect meaningful knowledge about AutoHotkey, editors, files, and downloads. This is a typical pattern for bots. The real challenge with ChatGPT is not fixing what it says but getting people to pay attention to what it says-- to see if what it says represents an advance or a setback, a truth or a falsehood, an innovation or a copycat.

ozzynotwood
Posts: 30
Joined: 16 Nov 2017, 19:19

Re: Online text editor for use with UrlDownloadToFile

Post by ozzynotwood » 01 Apr 2023, 18:50

mikeyww wrote:
01 Apr 2023, 08:28
I don't think that is the issue. The question is whether an online editing service hosts text files and also provides a URL for downloading the hosted files. Of course, if you have a file server, then you can just use FTP.
This is the correct context, thanks for clarifying for other readers. FTP won't work well because I also want the online editor/host to be accessible on the other PC's too. Additionally, I'm locked out of installing FTP clients on work PC's so web-based is the way to go. Hopefully somebody will know of such an editor before all my googled links turn purple 😂

User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

Re: Online text editor for use with UrlDownloadToFile

Post by mikeyww » 01 Apr 2023, 19:31

You can do something similar on Box & Dropbox, though Box may require a premium account. On Dropbox, you can upload & download your INI file at will. You can also create a link to the file such that it will be downloaded. The URL is like the following.

https:// dl.dropboxusercontent.com /s/[fileID]/test.ini?dl=1
Last edited by mikeyww on 01 Apr 2023, 19:37, edited 1 time in total.

ozzynotwood
Posts: 30
Joined: 16 Nov 2017, 19:19

Re: Online text editor for use with UrlDownloadToFile  Topic is solved

Post by ozzynotwood » 01 Apr 2023, 19:37

mikeyww wrote:
01 Apr 2023, 19:31
You can do something similar on Box & Dropbox, though Box may require a premium account. On Dropbox, you can upload & download your INI file at will. You can also create a link to the file such that it will be downloaded. The URL is like the following.

https://dl.dropboxusercontent.com/s/[fileID]/test.ini?dl=1
Your answer worked, I also followed this: https://zapier.com/blog/generate-direct-dropbox-link/

Thanks!

User avatar
flyingDman
Posts: 2817
Joined: 29 Sep 2013, 19:01

Re: Online text editor for use with UrlDownloadToFile

Post by flyingDman » 02 Apr 2023, 13:06

I do not know enough about Dropbox and Box, but I have used is Google Sheets for something like this. I allows you (incl. others you designate) to create and/or modify a sheet containing 1 or more columns and then to "publish it" (file - share - publish to web) as a .csv file. That file can then be downloaded; or better yet, the content can be downloaded to a variable (see here: https://www.autohotkey.com/docs/v1/lib/URLDownloadToFile.htm#WHR). The beauty of this is that the .csv is anonymous (I do not know how one could trace it back to the owner) and as soon as the sheet is updated the .csv is updated (give it 30 seconds or so to get re-published under the same URL).

Code: Select all

txt := whr("https://docs.google.com/spreadsheets/d/e/2PACX-1vRpLw8RARaVrHJaHX9sAdd8TTkzaByWEP9RU5DnICRahXeLSj8rKIulUXUiEfDGqeofdsjaxv2_qRCP/pub?gid=0&single=true&output=csv")
msgbox % txt

whr(url)
	{
	whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")        ;https://www.autohotkey.com/docs/commands/URLDownloadToFile.htm#WHR
	whr.Open("GET", url, true)
	whr.Send()
	whr.WaitForResponse()
	return whr.ResponseText
	}
14.3 & 1.3.7

Post Reply

Return to “Ask for Help (v1)”