Search found 46 matches

by Lem2001
27 Oct 2019, 15:37
Forum: Ask For Help
Topic: Retaining a text file's existing ANSI or Unicode format after editing
Replies: 1
Views: 168

Retaining a text file's existing ANSI or Unicode format after editing

  I'm using some Regex to perform text edits on the contents of a plain text ini file. FileDelete, TestINI_New.ini FileRead, AllFile, TestINI.ini FileAppend, % RegExReplace(AllFile, "`amsU)(?<=\[Recent\])(.*)(?=^\[\w+]$)","`n`n`n$2"), TestINI_New.ini run, TestINI_New.ini However, when these changes ...
by Lem2001
27 Oct 2019, 12:45
Forum: Ask For Help
Topic: Edit text within an .ini file Topic is solved
Replies: 13
Views: 797

Re: Edit text within an .ini file Topic is solved

Something like this: RegExReplace(AllFile, "s)(^|\R)\[Recent](?=(\R|$))\K(.*?(?=\R\[\w+](?2))|(.(?!.*\R\[\w+](?2))+)*$)", "`n`n`n") Thank you very much. This works great! I was ready to closely examine the changes made to the Regex command (compared to the previous solution) to see if I could start...
by Lem2001
22 Oct 2019, 16:12
Forum: Ask For Help
Topic: Edit text within an .ini file Topic is solved
Replies: 13
Views: 797

Re: Edit text within an .ini file Topic is solved

I can't believe that I am back asking for help on this topic again <sigh>. Sorry. Everything was working great, but I have discovered that after cleaning, when I next run the software (and more recent entries get created) the [Recent] section has moved to the very end of the .ini file! Presumably it...
by Lem2001
22 Oct 2019, 09:08
Forum: Ask For Help
Topic: Edit text within an .ini file Topic is solved
Replies: 13
Views: 797

Re: Edit text within an .ini file Topic is solved

3 blank lines require 4 line breaks. Yeah, that was the only part of the Regex command that I understood, so I had already fixed that bit by just adding another line break. $2 does nothing, it's redundant. I didn't know what $2 did, so I just left it alone. But now that I know it's not needed, I ha...
by Lem2001
21 Oct 2019, 23:37
Forum: Ask For Help
Topic: Edit text within an .ini file Topic is solved
Replies: 13
Views: 797

Re: Edit text within an .ini file Topic is solved

Odlanir wrote:
20 Oct 2019, 11:56
This should work:
This is amazing!

It covers every possible instance while keeping the next section heading (and the rest of the ini content) safe.

Thank you so much for your help.
by Lem2001
21 Oct 2019, 23:36
Forum: Ask For Help
Topic: Edit text within an .ini file Topic is solved
Replies: 13
Views: 797

Re: Edit text within an .ini file Topic is solved

AHKStudent wrote:
20 Oct 2019, 12:17
sorry OP for my long code
Not at all.

I am grateful to you for taking the time to reply to try to help me.
by Lem2001
20 Oct 2019, 10:27
Forum: Ask For Help
Topic: Edit text within an .ini file Topic is solved
Replies: 13
Views: 797

Re: Edit text within an .ini file Topic is solved

Thank you both for your replies. Odlanir , your first example was the one I ended up using. It is very clean and elegant (and works well). I could not have figured this out for myself (Regex is not my strong point). There is just one problem with it; the method that you've used for detecting the nex...
by Lem2001
18 Oct 2019, 16:00
Forum: Ask For Help
Topic: Edit text within an .ini file Topic is solved
Replies: 13
Views: 797

Edit text within an .ini file Topic is solved

How would I go about editing and ini file to partially remove some of its contents (between two section headers)? For example, if I had a file called settings.ini and within this file was sections (each one enclosed in square brackets) something like this: [Preferences] color=#ff00ee size=34 etc. [R...
by Lem2001
17 Oct 2019, 20:33
Forum: Ask For Help
Topic: Prevent repeat triggering while using KeyWait command Topic is solved
Replies: 6
Views: 282

Re: Prevent repeat triggering while using KeyWait command Topic is solved

Thank you Hellbent.

Your last code sample works absolutely perfectly!
It behaves exactly as I wanted.
by Lem2001
17 Oct 2019, 18:38
Forum: Ask For Help
Topic: Prevent repeat triggering while using KeyWait command Topic is solved
Replies: 6
Views: 282

Re: Prevent repeat triggering while using KeyWait command Topic is solved

Thank you very much for your reply.

It's almost what I require, but not quite. I would like the action to trigger on key down, not on key up.

At the moment nothing happens while they key is held down. It's only when key is released is the action is triggered.
by Lem2001
17 Oct 2019, 17:42
Forum: Ask For Help
Topic: Prevent repeat triggering while using KeyWait command Topic is solved
Replies: 6
Views: 282

Prevent repeat triggering while using KeyWait command Topic is solved

I'm using the following command to trigger an action on a long key press of F12. F12:: KeyWait, F12, T0.6 if A_TimeSinceThisHotkey >= 500 ; in milliseconds However, I want the F12 key to fire off only once per key press (even if it's held down) instead of it repeatedly triggering while the key is be...
by Lem2001
23 Jun 2019, 17:37
Forum: Ask For Help
Topic: Problem using Timers Topic is solved
Replies: 2
Views: 278

Re: Problem using Timers Topic is solved

Thank you.

That fixed it. They both work at the same time now.
by Lem2001
23 Jun 2019, 16:08
Forum: Ask For Help
Topic: Problem using Timers Topic is solved
Replies: 2
Views: 278

Problem using Timers Topic is solved

I have a script with the following code in it (see below). It contains only 2 timers, and one hotkey. However, only one of the timers will work at a time (whichever one is written first in the script). I may have been a bit over-enthusiastic with my 'returns', but I just can't seem to find the probl...
by Lem2001
18 Jun 2019, 00:38
Forum: Ask For Help
Topic: Making Windows Explorer script also work in File Dialogs
Replies: 5
Views: 473

Re: Making Windows Explorer script also work in File Dialogs

Thank you very much for the updated code (and helpful comments). I do appreciate it. Your code example works really well, but seeing as the icon sizes don't fit the views that I'm using, then the outcome is a bit of a case of one step forwards, two steps back. I guess I'll have to further trawl the ...
by Lem2001
17 Jun 2019, 05:38
Forum: Ask For Help
Topic: Making Windows Explorer script also work in File Dialogs
Replies: 5
Views: 473

Re: Making Windows Explorer script also work in File Dialogs

Thank you very much for this! I didn't realise that it would involve such significant changes to the code in order to get it to work. I'm a very basic beginner-level AHK user, so I was unaware of the limitations of Shell.Application object with respect to dialogs. I have tested out your second examp...
by Lem2001
15 Jun 2019, 11:44
Forum: Ask For Help
Topic: Making Windows Explorer script also work in File Dialogs
Replies: 5
Views: 473

Making Windows Explorer script also work in File Dialogs

I have been happily using the code below for many months (the source is credited in my comment) and it works wonderfully. However, I would like it to also work in File Dialogs. I changed the directive part of the code so that the hotkey is also detected in file dialogs (that was easy) but I don't un...
by Lem2001
14 Jun 2019, 05:28
Forum: Ask For Help
Topic: WinHide wihout Hotkey Topic is solved
Replies: 8
Views: 562

Re: WinHide wihout Hotkey Topic is solved

That was easier than I thought.

It works great on the currently assigned name, so it should obviously be fine for any alternative.

Thank you!
by Lem2001
13 Jun 2019, 04:53
Forum: Ask For Help
Topic: WinHide wihout Hotkey Topic is solved
Replies: 8
Views: 562

Re: WinHide wihout Hotkey Topic is solved

Hi, I've just discovered another issue. Today I started using my computer and the Listary object was back on all of my file dialogs. I had previously tested my script very thoroughly, and it had been working perfectly, so I had no idea what the problem could be. I then checked the object using Windo...
by Lem2001
11 Jun 2019, 16:25
Forum: Ask For Help
Topic: WinHide wihout Hotkey Topic is solved
Replies: 8
Views: 562

Re: WinHide wihout Hotkey Topic is solved

unfortunately not, see: https://www.autohotkey.com/docs/Language.htm#not-control-flow #IfWinExist can't trigger anything. Wow, thanks for this! I don't know how I have not seen this before. I have spent so much time in the past trying to get this to work, and I assumed that it was my bad code writi...
by Lem2001
11 Jun 2019, 08:13
Forum: Ask For Help
Topic: WinHide wihout Hotkey Topic is solved
Replies: 8
Views: 562

Re: WinHide wihout Hotkey Topic is solved

Thanks! It works, but there's a bit of an issue that I'm trying to deal with: The object appears briefly on the dialog before it disappears. I can get rid of this by reducing the duration of the timer, but I have to put it as low as 10ms before there is no visible 'flash' on the dialog. I really don...

Go to advanced search