[SOLVED] winget, myList, list Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
geotabs
Posts: 7
Joined: 14 May 2018, 14:20

[SOLVED] winget, myList, list

16 May 2018, 12:00

I am trying to get a script that would wimaximize a list of Stock Tickers on multiple windows that I trade and here is the code I am using but doesn't load them

Code: [Select all] [Download] GeSHi © Codebox Plus

#7::
KeyWait p
SetTitleMatchMode, 2
winget, myList, list, FAS, FAZ, GUSH, DRIP, LABD, LABU, UWT, DWT, SPXL, SPXU, SOXL, SOXS, TECL, TECS, JNUG, JDST, NUGT, DUST, VXX, UVXY, SVXY, TZA, TNA, DRN, DRV, YINN, YANG, SQQQ, TQQQ
Loop, %myList%
{
WinActivate, % "ahk_id" myList%a_index%
ControlSend, _WwG1, p, % "ahk_id" myList%a_index%
}
return


It could have any 5 of the symbols at one time and then change between them so I just put them all in there!
Where did I go wrong?

Thanks
User avatar
TLM
Posts: 1198
Joined: 01 Oct 2013, 07:52

Re: winget, myList, list

16 May 2018, 15:56

Try

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Image Image Image
geotabs
Posts: 7
Joined: 14 May 2018, 14:20

Re: winget, myList, list

17 May 2018, 08:57

TLM wrote:Try

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



Thanks for the help TLM but this doesn't work!

What I have is multiple windows of the same symbol with different times like 3 Min, 15 Min 60 Min but the symbol is constant, this is the script that I am using now but if I change the minutes on 1 and then forget to change it back I have to then manually change for script to work again so would be nice to have a script that just uses the symbol!

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


As you can see it's quite lengthy and I would have to add a whole lot of (Min) so if I do change then it would be OK but would like to simplify this if I can!

Thanks
User avatar
TLM
Posts: 1198
Joined: 01 Oct 2013, 07:52

Re: winget, myList, list

17 May 2018, 10:04

I see.. Well as long as the window title contains a similarly repeating patterns, SetTitleMatchMode should be all you need.
For instance in the case of a window with DBX in it....should be enough to activate all windows beginning with the title DBX (

Give this a try and let me know if you still have issues.
Image Image Image
geotabs
Posts: 7
Joined: 14 May 2018, 14:20

Re: winget, myList, list

17 May 2018, 10:28

TLM wrote:I see.. Well as long as the window title contains a similarly repeating patterns, SetTitleMatchMode should be all you need.
For instance in the case of a window with DBX in it....should be enough to activate all windows beginning with the title DBX (

Give this a try and let me know if you still have issues.


Thanks Ill give it a try and let you know!

Do you think it's possible to have a list script with all the symbols?

Thanks
geotabs
Posts: 7
Joined: 14 May 2018, 14:20

Re: winget, myList, list

17 May 2018, 10:43

TLM wrote:I see.. Well as long as the window title contains a similarly repeating patterns, SetTitleMatchMode should be all you need.
For instance in the case of a window with DBX in it....should be enough to activate all windows beginning with the title DBX (

Give this a try and let me know if you still have issues.


So this on only brings up the (3 MIN) 1 and the 15 MIN and 60 MIN don't come up
User avatar
TLM
Posts: 1198
Joined: 01 Oct 2013, 07:52

Re: winget, myList, list  Topic is solved

17 May 2018, 11:19

The fact that SetTitleMatchMode works is a good sign.
Now you should be able to activate multiple windows from arrays containing the symbols and time intervals rather than having to manually enter them.
Something like this ( NOTE: the message box is only there to show you the given window title, it should be removed ):

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

The benefit of this approach is you can easily update/add to the symbols and or time intervals :)
Image Image Image
geotabs
Posts: 7
Joined: 14 May 2018, 14:20

Re: winget, myList, list

17 May 2018, 11:54

TLM wrote:The fact that SetTitleMatchMode works is a good sign.
Now you should be able to activate multiple windows from arrays containing the symbols and time intervals rather than having to manually enter them.
Something like this ( NOTE: the message box is only there to show you the given window title, it should be removed ):

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

The benefit of this approach is you can easily update/add to the symbols and or time intervals :)


Thank you very much this one worked but this is how I got it to work!

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



I wonder if we used SymbolArray in the first try if that would have worked without the IntervalArray?
Thanks for the help TML
User avatar
TLM
Posts: 1198
Joined: 01 Oct 2013, 07:52

Re: winget, myList, list

17 May 2018, 12:43

geotabs wrote:I wonder if we used SymbolArray in the first try if that would have worked without the IntervalArray?

Not without SetTitleMatchMode ;)
Glad everything is working for you. Feel free to ask if you have any further questions.
Image Image Image
DRocks
Posts: 9
Joined: 08 May 2018, 10:20

Re: [SOLVED] winget, myList, list

17 May 2018, 23:11

Hey TLM,

I've tried this example for myself and adapted it to try creating a manual selected Window Manager and I am there now:
Do you think I'm using Arrays correctly? Or is it noob coded? I understand myself with repetitive lines on the iniwrite but is it good and efficient to go that way according to the pros?

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

User avatar
TLM
Posts: 1198
Joined: 01 Oct 2013, 07:52

Re: [SOLVED] winget, myList, list

18 May 2018, 10:35

If you are parsing the array and the script is working that's good enough imo.
Image Image Image
geotabs
Posts: 7
Joined: 14 May 2018, 14:20

Re: winget, myList, list

18 May 2018, 12:16

TLM wrote:
geotabs wrote:I wonder if we used SymbolArray in the first try if that would have worked without the IntervalArray?

Not without SetTitleMatchMode ;)
Glad everything is working for you. Feel free to ask if you have any further questions.


Hi TLM I have everything set up not but ran into a small problem that I can't figure out, when I run this script

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



It also activates this one

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



Any Ideas why??

Thanks
User avatar
TLM
Posts: 1198
Joined: 01 Oct 2013, 07:52

Re: [SOLVED] winget, myList, list

18 May 2018, 12:34

When the title match mode is set to 2, it will find any window containing the string.
So for instance both of these windows will be considered a match: some window title or 12345some window title890

If the symbol & the intervals are exactly the same as the window titles from start to end, switching to SetTitleMatchMode, 1 or 3 should fix this issue.
If not, you can use SetTitleMatchMode, RegEx with a needle pattern that resembles the window title.

For now, give 1 or 3 a try and let me know what happens :)
Image Image Image
geotabs
Posts: 7
Joined: 14 May 2018, 14:20

Re: [SOLVED] winget, myList, list

18 May 2018, 12:59

TLM wrote:When the title match mode is set to 2, it will find any window containing the string.
So for instance both of these windows will be considered a match: some window title or 12345some window title890

If the symbol & the intervals are exactly the same as the window titles from start to end, switching to SetTitleMatchMode, 1 or 3 should fix this issue.
If not, you can use SetTitleMatchMode, RegEx with a needle pattern that resembles the window title.

For now, give 1 or 3 a try and let me know what happens :)


Setting the SetTitleMatchMode 1 works but it's strange as this is what I have now and the only one that does this is #2::, can you also use numbers higher than 3 for SetTitleMatchMode ?

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



Thanks Again :)
User avatar
TLM
Posts: 1198
Joined: 01 Oct 2013, 07:52

Re: [SOLVED] winget, myList, list

18 May 2018, 14:24

geotabs wrote:Setting the SetTitleMatchMode 1 works but it's strange as this is what I have now and the only one that does this is #2::, can you also use numbers higher than 3 for SetTitleMatchMode ?
It's most likely activating windows if the symbol is contained in their title.
There's no higher SetTitleMatchMode than 3 but there is RegEx mode that allows you to use advanced Regular Expressions as the matching pattern.

BTW AHk allows you to wrap parts of you script that repeat into functions.
For instance:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

htms
Image Image Image
DRocks
Posts: 9
Joined: 08 May 2018, 10:20

Re: [SOLVED] winget, myList, list

Yesterday, 08:10

This last example is very nice TLM

thank you for your help it also helped me indirectly. This method allowed me to write my own Window manager for specific needs and its better than one I was evaluating worth 20USD!

thanks a bunch :)

Return to “Ask For Help”

Who is online

Users browsing this forum: Gandalf_yayo, ouboss, Stavencross, ZOMBYSPIDER and 37 guests