Search found 188 matches

by roysubs
10 Jan 2020, 06:38
Forum: Ask For Help
Topic: Hotstrings / Hotkeys
Replies: 1
Views: 75

Hotstrings / Hotkeys

I know that I can do multiple hotkeys for a single definition, e.g. ^#!F3:: ^#!F4:: <code here> return But I want to have a Hotstring alternative also and I can't seem to work out how to do that: ^#!F3:: ::{Numpad0}{Numpad0}{Numpad0}{Numpad0}:: <code here> return Can someone advise me how to achieve...
by roysubs
26 Oct 2019, 09:06
Forum: Ask For Help
Topic: Change font in OneNote / Word
Replies: 4
Views: 297

Re: Change font in OneNote / Word

ok, thanks for that boiler, that's really interesting. I know nothing about Macros in Office really. I went to this page to try to understand, but actually, the Macro failed in just the same way that my AHK failed :( I'll keep trying with Macros, but I guess it's new territory for me... https://www....
by roysubs
26 Oct 2019, 08:39
Forum: Ask For Help
Topic: Change font in OneNote / Word
Replies: 4
Views: 297

Change font in OneNote / Word

In OneNote and Word, I am always having to change fonts for code to Consolas so came up with an idea to use the shortcuts to automate this! But it's not working out. I've tried "!h" or "{Alt}" then "h", or "{Alt}h" etc but however I do this, instead of replicating the keypresses that will change the...
by roysubs
02 Oct 2019, 07:43
Forum: Ask For Help
Topic: Pause all hotkeys Topic is solved
Replies: 3
Views: 222

Re: Pause all hotkeys Topic is solved

Great, thanks. For my needs, the Suspend is perfect, I'll just use a toggle
^#!s::Suspend, Toggle

I guess the 'Toggle' is redundant as that's the default behaviour.

Thanks also for the overview of all of the IfWin[Not]Active / #IfWin[Not]Exist / #If [!]WinExist options.
by roysubs
02 Oct 2019, 03:57
Forum: Ask For Help
Topic: Pause all hotkeys Topic is solved
Replies: 3
Views: 222

Pause all hotkeys Topic is solved

I have an autohotkey script "Main.ahk" that has a few thousand lines with all of my hotkeys. However, I recently started using an old game emulator (ZX Spectrum lol) and when I am in that, my automation messes up the games, so I have to exit Main.ahk before I run that. Alternatively, is there a way ...
by roysubs
30 Sep 2019, 05:07
Forum: Ask For Help
Topic: Test for running script Topic is solved
Replies: 4
Views: 261

Re: Test for running script Topic is solved

Thanks for the answers. This ComObjGet.ExecQuery solution is fantastic and will help with some plans I have to load ahk modules as and when required! :D
by roysubs
30 Sep 2019, 03:18
Forum: Ask For Help
Topic: Test for running script Topic is solved
Replies: 4
Views: 261

Test for running script Topic is solved

I have an AutoHotkey script that I want to start another .ahk script but only if that other script is not already running. In Task Manager, I can only see the following names of the tasks: AutoHotkey Unicode 64-bit AutoHotkey Unicode 64-bit So there is no way to differentiate by the task name. Howev...
by roysubs
27 Sep 2019, 07:30
Forum: Ask For Help
Topic: Remove trailing `n
Replies: 2
Views: 178

Re: Remove trailing `n

Great thanks. :)
by roysubs
27 Sep 2019, 06:54
Forum: Ask For Help
Topic: Remove trailing `n
Replies: 2
Views: 178

Remove trailing `n

I've built a string that has multiple lines but want to remove the last `n

The following works, but this is a deprecated command:
StringTrimRight, MyList, MyList, 1

Can someone recommend a better way to achieve this with non-deprecated commands?
by roysubs
20 Sep 2019, 10:44
Forum: Ask For Help
Topic: #IfWinActive with %var% in name
Replies: 9
Views: 516

Re: #IfWinActive with %var% in name

ok, but he suggested this could be achieved with #If WinActive()
I'm trying #If Winactive and not getting that working either. Any tips on how to fix this?
by roysubs
20 Sep 2019, 10:39
Forum: Ask For Help
Topic: #IfWinActive with %var% in name
Replies: 9
Views: 516

Re: #IfWinActive with %var% in name

ok, I tried changing it as you said, but still fails. I tried #If WinActive("%A_ScriptName% - Visual Studio Code") and #If WinActive(%A_ScriptName% - Visual Studio Code) Can you advise on how I'm doing it wrongly? #If WinActive("%A_ScriptName% - Visual Studio Code") ^s:: Send, {ctrl down}s{ctrl up} ...
by roysubs
20 Sep 2019, 10:32
Forum: Ask For Help
Topic: #IfWinActive with %var% in name
Replies: 9
Views: 516

#IfWinActive with %var% in name

I use the following to save and reload my script and it works great. I want to make it generic so that I can add this block to any script to allow save-and-reload. SetTitleMatchMode, 2 #IfWinActive, MyScript.ahk - Visual Studio Code ^s:: Send, {ctrl down}s{ctrl up} Sleep 100 Reload MsgBox, , Reload ...
by roysubs
07 Sep 2019, 04:49
Forum: Ask For Help
Topic: FileExist true/false
Replies: 3
Views: 240

Re: FileExist true/false

Ah ... thanks! I get hit by this all of the time. It's like working with two different language syntaxes in one language! I seldom know which thing to use. Is there a way to tell short of trial and error?? :(
by roysubs
07 Sep 2019, 04:38
Forum: Ask For Help
Topic: FileExist true/false
Replies: 3
Views: 240

FileExist true/false

Can someone tell me why this fails? The Ahk2Exe.exe does exist, but the MsgBox is skipped every time.

Code: Select all

AHKdir  := "C:\Program Files\AutoHotkey"
if FileExist("%AHKdir%\Compiler\Ahk2Exe.exe")
    MsgBox, 1
by roysubs
27 Aug 2019, 06:12
Forum: Ask For Help
Topic: Indenting 'Send' output
Replies: 2
Views: 303

Re: Indenting 'Send' output

Thanks ilhom. Ok, I've made some progress on this. I know that there are lots of very advanced snippet managers, but I just don't need that complexity. Being able to spit out text that I need as I'm coding in a simple way is very useful to me (and that I can control on a per app basis with #IfWinAct...
by roysubs
26 Aug 2019, 09:44
Forum: Ask For Help
Topic: Indenting 'Send' output
Replies: 2
Views: 303

Indenting 'Send' output

I want to do some code snippets, like this: psheader = (LTrim <`# .SYNOPSIS ... .PARAMETER <inputPipeline> ... .PARAMETER <Language> ... .PARAMETER <username> ... .EXAMPLE ... .EXAMPLE ... .NOTES `n`tAuthor: test `n`tBlog : www.test.com `n`tFile Name: stuff.ps1 `n`tRequires: Powershell V2 `n`tLegal:...
by roysubs
22 Aug 2019, 10:55
Forum: Ask For Help
Topic: IfExist multiple files and/or
Replies: 2
Views: 222

Re: IfExist multiple files and/or

Excellent, thanks! :)
by roysubs
22 Aug 2019, 10:23
Forum: Ask For Help
Topic: IfExist multiple files and/or
Replies: 2
Views: 222

IfExist multiple files and/or

IfExist, %file1%
{
IfExist, %file2%
{
<do stuff>
}
}

Is there a way to do this on a single line? Something like:

IfExist %file1% AND %file2% AND %file3%
by roysubs
17 Aug 2019, 12:07
Forum: Ask For Help
Topic: FileDelete
Replies: 4
Views: 435

Re: FileDelete

To replicate the attempt to delete as it is in my script, I used the following. Y: is already mapped to the UNC path under my currently logged in user. sel_first := "Y:\0\!.Complete\TestFolder\0" MsgBox, %sel_first% FileDelete, %sel_first%\www.* MsgBox, %A_LastError% A_LastError always comes back as...
by roysubs
17 Aug 2019, 11:31
Forum: Ask For Help
Topic: FileDelete
Replies: 4
Views: 435

Re: FileDelete

Thanks for the replies. I saw it working sometimes and then sometimes not, and I *think* the reason is: UNC paths. FileDelete, C:\temp\Www.bla.bla.jpg <= works FileDelete, \\Server\drive-d\Www.bla.bla.jpg <= fails A lot of the things I'm doing require me to use UNC paths. Is this just an issue with ...

Go to advanced search