Code: Select all
^q::
Send "#{t}{Home}{Right 11}{Enter}"
return
Code: Select all
^q::
Send "#{t}{Home}{Right 11}{Enter}"
return
In my opinion, you have already found the best way to do that. There is an alternate method but it requires getting X,Y coordinates of the application in question. For example, this script launches MS Word on my PC.Sir MR potatohead wrote: ↑24 Jan 2024, 12:52Thanks. Yes , now it works normal. But how would you write it if you were to make such a shortkey?? I mean I have no knowledge of scripting, just started 2 weeks ago playing with AHK, still, my script looks silly to meI am sure there are better ways to run the 12th,13th,14th,.... app on taskbar.
Code: Select all
CoordMode, Mouse, Screen
Click, 834, 1068
ExitApp
I don't think you understand the example script I provided for you above. **CoordMode** is short for coordinate mode, not coordination. So in the example I provided for you, it tells AHK where to click relative to the screen. You should look through the AHK help files for more details on what this does.
This absolutely no sense whatsoever. I don't even know what you're trying to say. It doesn't matter how many applications you have on your taskbar. All you have to do is just send the right arrow key the appropriate number of times to launch it.Sir MR potatohead wrote: ↑26 Jan 2024, 20:49For example if I have 11 apps on the taskbar, this script presses T 12 times and it will open the 3rd item on taskbar. Still I believe there must be a specific script to play with the taskbar. thanks for the idea anyways.
Code: Select all
^q::
Send "#{t}{Right 11}{Home}{Enter}"
return
Code: Select all
^q::
Send "#{t}{Right 8}+{Enter}"
return
Code: Select all
^q::
Send, #{t}{Right 8}+{Enter}
return
Using the script provided by the OP, I added the comma and deleted the Home key.
Code: Select all
^q::
Send, #{t}{Right 8}+{Enter}
return
For the first 10 apps in your taskbar, you don't need to press Windows-T, arrow over a certain number of times, and press Enter. Instead, you can just press the Windows key and any single digit from 0 to 9 to focus any one of the first ten apps in your taskbar.M4verick wrote: ↑17 Feb 2024, 23:34The 8th icon on my Windows taskbar is Windows Notepad. When I run the script with the comma, it works perfectly.Code: Select all
^q:: Send, #{t}{Right 8}+{Enter} return
Code: Select all
; pin Windows apps to taskbar then open/focus them with
; mnemonic shortcuts instead of built-in Win-number
; Win-E N T F H | Explorer Notepad Typora Firefox Thunderbird
; With ad'l modifiers (Ctrl/Shift/Alt), ad'l/alt. functionality
#E::Send {Blind}#1
#N::Send {Blind}#2
#T::Send {Blind}#3
#F::Send {Blind}#4
#H::Send {Blind}#5
+#E::Send {Blind}+#1
+#N::Send {Blind}+#2
+#T::Send {Blind}+#3
+#F::Send {Blind}+#4
+#H::Send {Blind}+#5
^#E::Send {Blind}^#1
^#N::Send {Blind}^#2
^#T::Send {Blind}^#3
^#F::Send {Blind}^#4
^#H::Send {Blind}^#5
!#E::Send {Blind}!#1
!#N::Send {Blind}!#2
!#T::Send {Blind}!#3
!#F::Send {Blind}!#4
!#H::Send {Blind}!#5
I have no idea what you mean by this. We're talking about using the right arrow key to highlight the desired application on the taskbar. The number of Notepad windows that are open when I run this script has no relevance. Can you please clarify your comment?
I’m saying that I can’t reproduce your problem. It works exactly the same whether there is a comma or not. And you say you are using it to select the Notepad icon. When I do that, it opens another instance, thus changing the number of icons on the taskbar, causing it to act differently the next time (at least with my taskbar settings where it groups icons of the same application). So I was just saying to make sure the number of icons is the same when you try it one way vs. another. In that sense, it is directly relevant.
When I tested the OP's script without the comma, it had the undesired effect of launching the 6th icon on the taskbar instead of the 8th. Just to be clear about this, the number of Notepad windows that were open at the time the script was executed had no bearing on this. 1 Notepad window versus 10 of them - it still launched the WRONG application.boiler wrote: ↑18 Feb 2024, 13:44I’m saying that I can’t reproduce your problem. It works exactly the same whether there is a comma or not. And you say you are using it to select the Notepad icon. When I do that, it opens another instance, thus changing the number of icons on the taskbar, causing it to act differently the next time (at least with my taskbar settings where it groups icons of the same application). So I was just saying to make sure the number of icons is the same when you try it one way vs. another. In that sense, it is directly relevant.
Again, I don’t see any reason why the presence of the optional comma should make a difference, and it indeed doesn’t for me, so I’m trying to identify what else might be causing it to behave differently.
OP’s original script didn’t only have a comma wrong with it. It also had quotation marks that don’t belong. As I asked before, are you running two scripts where the only difference is the comma? And there is only one script running, as opposed to both possibly running at the same time?
I know that the quotation marks that don't belong. I told him that already.
I don't recall you asking that question. I have reviewed your comments in this thread and I don't see where you asked that - it's possible I missed it. Just to be clear about this - I am not running 2 different version of the OP's script at the same time. I am an AHK novice but I am not stupid enough to do that sort of thing. I tested 1 version without the comma and I tested another version with the comma. 1 AT A TIME. To be even more clear about this - I completely exited one script when I was done testing and then I loaded the 2nd version afterwards to test.
It has no bearing. I don't know why you insist that it does. Using Notepad as an example, Notepad will ALWAYS be the 8th icon on my taskbar unless of course I change the order of the icons on the taskbar. See screenshot.
Code: Select all
^q::
Send, #{t}{Right 8}+{Enter}
return
Not that it’s important, but to clarify: The part in red is what I meant by having asked that before — not the next sentence.
I’ve helped a lot of people find the source of issues they couldn’t explain, and these kinds of things happen all the time, and it sometimes is the sole issue. When it does happen, I don’t consider them to be stupid. It just happens, so I checked. Apparently, you are taking my attempts to eliminate potential causes of the issue other than the presence of the “optional” comma personally, so I won’t pursue it anymore. If anyone else can reproduce the issue, then I suggest posting it in the Bug Reports section, even though it is now primarily meant for v2 bugs, since it would be behavior inconsistent with the documentation.M4verick wrote: ↑ I am an AHK novice but I am not stupid enough to do that sort of thing. I tested 1 version without the comma and I tested another version with the comma. 1 AT A TIME. To be even more clear about this - I completely exited one script when I was done testing and then I loaded the 2nd version afterwards to test.
Code: Select all
^q::
Send, #{t}{Right 6}+{Enter}
return
I don't doubt you have helped a lot of people, including myself in the past. My only frustration with you is that keep insisting the number of Notepad windows running has a direct bearing on the scripting working correctly or not. Doesn't even seem like you've tested the script yourself on your end! The other possibility is that you don't have your icons grouped together on the taskbar in which case if you have 3 Notepad windows open, you're gonna see 3 Notepad icons (separately) on the taskbar which could possibly affect how the script runs. I also thought that I had explained clearly enough how I tested the two versions (1 with the comma, the other without comma). Apparently I did not explain it clearly enough. Either way, I'm done with the thread - I was just trying to help out the OP with his taskbar issue.boiler wrote: ↑19 Feb 2024, 23:42I’ve helped a lot of people find the source of issues they couldn’t explain, and these kinds of things happen all the time, and it sometimes is the sole issue. When it does happen, I don’t consider them to be stupid. It just happens, so I checked. Apparently, you are taking my attempts to eliminate potential causes of the issue other than the presence of the “optional” comma personally, so I won’t pursue it anymore. If anyone else can reproduce the issue, then I suggest posting it in the Bug Reports section, even though it is now primarily meant for v2 bugs, since it would be behavior inconsistent with the documentation.
Users browsing this forum: peter_ahk and 333 guests