Search found 17 matches

by J0RDAN
02 Apr 2023, 00:58
Forum: Ask for Help (v1)
Topic: How do I monitor a specific file in a directory? Topic is solved
Replies: 33
Views: 1800

Re: How do I monitor a specific file in a directory? Topic is solved

Code: Select all

fileread, contents, g:\List1.txt
if not errorlevel
{
sort, contents, c cl u,
filedelete, g:\List1.txt
fileappend, %contents%, g:\List1.txt
contents := ""
}
Would this be a better way to write it?
by J0RDAN
31 Mar 2023, 14:16
Forum: Ask for Help (v1)
Topic: How do I monitor a specific file in a directory? Topic is solved
Replies: 33
Views: 1800

Re: How do I monitor a specific file in a directory? Topic is solved

There is no reason to set it specifically at 5 seconds. You can set at much lower than that. 1 seems a bit excessive but I don't think it will impact the performance of your PC much. A sensible value would something like 100 to 250. It will appear instantaneous. Got it! Thank you and boiler so much...
by J0RDAN
30 Mar 2023, 20:04
Forum: Ask for Help (v1)
Topic: How do I monitor a specific file in a directory? Topic is solved
Replies: 33
Views: 1800

Re: How do I monitor a specific file in a directory? Topic is solved

I tried it on the bigger script initially with no success, tried it on your code and it made your code work, and then here's the baffling part: I made no changes to the bigger script and it just starts working. Out of nowhere. It's the same one I was using yesterday, I haven't touched it. It has #Pe...
by J0RDAN
30 Mar 2023, 15:51
Forum: Ask for Help (v1)
Topic: How do I monitor a specific file in a directory? Topic is solved
Replies: 33
Views: 1800

Re: How do I monitor a specific file in a directory? Topic is solved

Does it work on your system? I'm running Windows 10. I'm not trying to get your full code working. That's not the way to troubleshoot. As I said before: Make sure you know how to get either flyingDman’s original script or the one I posted to work before trying to incorporate it into your larger scr...
by J0RDAN
30 Mar 2023, 14:30
Forum: Ask for Help (v1)
Topic: How do I monitor a specific file in a directory? Topic is solved
Replies: 33
Views: 1800

Re: How do I monitor a specific file in a directory? Topic is solved

That’s not what I meant. I meant the WatchFolder-based script. I only showed you how to add flyingDman’s script to what you had. Make sure you know how to get either flyingDman’s original script or the one I posted to work before trying to incorporate it into your larger script. Oh, my mistake. I'v...
by J0RDAN
29 Mar 2023, 19:30
Forum: Ask for Help (v1)
Topic: How do I monitor a specific file in a directory? Topic is solved
Replies: 33
Views: 1800

Re: How do I monitor a specific file in a directory? Topic is solved

You ran the exact the script I posted and nothing else in that script (with WatchFolder.ahk as a separate file in the same folder as your script)? And then you manually changed the List1.txt file and saved it and it didn't show a MsgBox? Pretty much. I didn't get the original WatchFolder.ahk if tha...
by J0RDAN
29 Mar 2023, 17:39
Forum: Ask for Help (v1)
Topic: How do I monitor a specific file in a directory? Topic is solved
Replies: 33
Views: 1800

Re: How do I monitor a specific file in a directory? Topic is solved

Hm, I see. Well, do you have any ideas as to why it's not working then? Like I said I downloaded the version from your post and I haven't seen it trigger any message boxes.
by J0RDAN
29 Mar 2023, 17:05
Forum: Ask for Help (v1)
Topic: How do I monitor a specific file in a directory? Topic is solved
Replies: 33
Views: 1800

Re: How do I monitor a specific file in a directory? Topic is solved

settimer,updatedscript,500 #maxthreadsperhotkey 999999999 #noenv #persistent #singleinstance force #warn sendmode input setworkingdir %a_scriptdir% fileread, contents, g:\List1.txt if not errorlevel { sort, contents filedelete, g:\List1.txt fileappend, %contents%, g:\List1.txt contents := "" } slee...
by J0RDAN
29 Mar 2023, 14:52
Forum: Ask for Help (v1)
Topic: How do I monitor a specific file in a directory? Topic is solved
Replies: 33
Views: 1800

Re: How do I monitor a specific file in a directory? Topic is solved

This is the approach I'd like to go with. However, I'm getting 2 errors: Warning: This variable has not been assigned a value. Specifically: flag (a global variable) Warning: This variable has not been assigned a value. Specifically: oldtmstmp (a global variable) Those are not errors, they are just...
by J0RDAN
29 Mar 2023, 14:16
Forum: Ask for Help (v1)
Topic: How do I monitor a specific file in a directory? Topic is solved
Replies: 33
Views: 1800

Re: How do I monitor a specific file in a directory? Topic is solved

If Watchfolder is overkill for 1 file, you can use this: settimer, lbl, 5000 ; checks every 5 seconds lbl: FileGetTime, tmstmp, %A_ScriptDir%\List1.txt if (oldtmstmp != tmstmp AND flag) Msgbox The file has changed! oldtmstmp := tmstmp, flag := 1 return This is the approach I'd like to go with. Howe...
by J0RDAN
28 Mar 2023, 20:44
Forum: Ask for Help (v1)
Topic: How do I monitor a specific file in a directory? Topic is solved
Replies: 33
Views: 1800

Re: How do I monitor a specific file in a directory? Topic is solved

boiler wrote:
28 Mar 2023, 20:32
Check out WatchFolder().
How would I go about implementing this in my own script? I want my script to reload every time it detects a change in List1.txt and ignore all other files in said directory.
by J0RDAN
28 Mar 2023, 18:42
Forum: Ask for Help (v1)
Topic: How do I monitor a specific file in a directory? Topic is solved
Replies: 33
Views: 1800

How do I monitor a specific file in a directory? Topic is solved

https://www.autohotkey.com/boards/viewtopic.php?t=76244 teadrinker's code does what I'm trying to go for, however, it monitors the entire directory. I want to store a frequently updated list in a directory with other files that also frequently change, but I only want it to monitor the list. So say I...
by J0RDAN
05 Nov 2022, 17:23
Forum: Ask for Help (v1)
Topic: How do I run bits of code on script 2 from 1? Topic is solved
Replies: 9
Views: 612

Re: How do I run bits of code on script 2 from 1? Topic is solved

You can #Include it. https://www.autohotkey.com/docs/commands/_Include.htm If needed, you could also determine when the file changes, and then Reload , or Reload manually. • FileGetTime This works beautifully! Thank you! I had to comprimise my "No code in the dictionary" rule but it's OK because it...
by J0RDAN
05 Nov 2022, 17:16
Forum: Ask for Help (v1)
Topic: How do I run bits of code on script 2 from 1? Topic is solved
Replies: 9
Views: 612

Re: How do I run bits of code on script 2 from 1? Topic is solved

So, what are the advantages of your script over https://www.autohotkey.com/download/AutoCorrect.ahk (which I have used over 10 years) ? None, I'm making this for me. Just putting in things I find useful, not really for a general user experience. People can use it if they like though I don't really ...
by J0RDAN
03 Nov 2022, 00:36
Forum: Ask for Help (v1)
Topic: How do I run bits of code on script 2 from 1? Topic is solved
Replies: 9
Views: 612

Re: How do I run bits of code on script 2 from 1? Topic is solved

I'm bad at explaining things. I'll link the GitHub repository and explain in detail. https://github.com/JO-R-D-AN/AutoCorrect-Beta So it's an AutoCorrection script, I want to store the list of misspellings (Dictionary.ahk) separate from the main code (AutoCorrect.ahk) so I can just sort the entire l...
by J0RDAN
02 Nov 2022, 19:56
Forum: Ask for Help (v1)
Topic: How do I run bits of code on script 2 from 1? Topic is solved
Replies: 9
Views: 612

Re: How do I run bits of code on script 2 from 1? Topic is solved

It sort of has code. Like it follows the :*:@email::my email address format, not sure if that counts as AutoHotkey code. Also I looked at the documentation and wrote

Code: Select all

AutoHotkey.exe /force 2.ahk #NoTrayIcon
but it says unrecognized action. Did I format that incorrectly?
by J0RDAN
02 Nov 2022, 17:42
Forum: Ask for Help (v1)
Topic: How do I run bits of code on script 2 from 1? Topic is solved
Replies: 9
Views: 612

How do I run bits of code on script 2 from 1? Topic is solved

Hope this is the right place to be posting this. 1.ahk launches with some code and then it launches 2.ahk so both are running at the same time. 2.ahk is a list of words that gets updated very frequently, so I don't want code in it. However, since it gets updated (and relaunched) frequently, it's alw...

Go to advanced search