Moving/sorting items in list view

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
lukasi273
Posts: 2
Joined: 13 Nov 2015, 07:11

Moving/sorting items in list view

13 Nov 2015, 07:22

Hello guys!

I'll try my best to explain what I'm looking for... :) I need a script that will move items in list view based on the items that I currently have selected.

In order for this to work properly, AHK needs to grab a list of ALL the items in the list view and another list of just the selected items. The script should move 'Item A' to the top of my selection and 'Item B' to the bottom of my selection. 'Item A' and 'Item B' will always have the same, static name in the list, so their name can be used to determine their location.

I can move 'Item A' and 'Item B' up/down using hotkeys provided by the program (CTRL - UP, move selected item up // CTRL - DOWN, move selected item down).

To help clarify, I provide a couple examples :

Image

Image

User 'maestrith' also kindly provided me with this example that aims to do something similar - http://autohotkey.com/board/topic/10170 ... nge-items/

Unfortunately I'm just a beginner at AHK, so I'm unable to edit it for my needs.

Help is much appreciated, thank you in advance!
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: Moving/sorting items in list view

13 Nov 2015, 17:25

I have not looked at maestrith's script.

Are you able to get any values when you use commands such as ControlGetFocus? I hope that would be able to tell you what items you have selected, or at least their indexes. Cause if we know where the first select item is, we can put Plugin A at that index, and if we know where the second selected item is, we can put Plugin B at that index+1. (Or would it be +2 cause Plugin A would offset everything by 1?)

Though, reading that documentation, it doesn't seem like it'll give you a list. Something else would need to be done, and I'm unfortunately unaware of what that would be. To clarify, this is a non-AHK program? If it were an AHK progam using an AHK gui, it should be easier to figure out.
lukasi273
Posts: 2
Joined: 13 Nov 2015, 07:11

Re: Moving/sorting items in list view

14 Nov 2015, 05:14

Exaskryz wrote:I have not looked at maestrith's script.

Are you able to get any values when you use commands such as ControlGetFocus? I hope that would be able to tell you what items you have selected, or at least their indexes. Cause if we know where the first select item is, we can put Plugin A at that index, and if we know where the second selected item is, we can put Plugin B at that index+1. (Or would it be +2 cause Plugin A would offset everything by 1?)

Though, reading that documentation, it doesn't seem like it'll give you a list. Something else would need to be done, and I'm unfortunately unaware of what that would be. To clarify, this is a non-AHK program? If it were an AHK progam using an AHK gui, it should be easier to figure out.
You are correct it's not AHK program. It's a window within a digital-audio-workstation Reaper. Someone suggested that ImageSearch could/would work but I'm not sure :/
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: Moving/sorting items in list view

14 Nov 2015, 09:26

PixelSearch may be viable, if all the options are visible on screen and there is no need to scroll a scrollbar. You could use it to find all areas that are blue in the list, indicating a highlight. You can calculate the coordinates for each slot relative to the window to decide where the top and bottom are and perform an individual pixelsearch in each of those slots for something blue. Then, you can use ImageSearch to decide where the Plugin A and Plugin B currently are, and move accordingly. Very tricky stuff, but it may work.
jonnyhotkeys
Posts: 8
Joined: 18 Jan 2016, 13:26

Re: Moving/sorting items in list view

20 Jan 2016, 06:21

this might not be a good question, but have you tried using the reaper action list (maybe with sws extensions) to build these macros?

Check this
jonnyhotkeys
Posts: 8
Joined: 18 Jan 2016, 13:26

Re: Moving/sorting items in list view

29 Jan 2017, 12:34

Exaskryz wrote:PixelSearch may be viable, if all the options are visible on screen and there is no need to scroll a scrollbar. You could use it to find all areas that are blue in the list, indicating a highlight. You can calculate the coordinates for each slot relative to the window to decide where the top and bottom are and perform an individual pixelsearch in each of those slots for something blue. Then, you can use ImageSearch to decide where the Plugin A and Plugin B currently are, and move accordingly. Very tricky stuff, but it may work.
do you need a script running to detect these things?

or is there a 'debugging' tutorial, or some other tools?


With some winspy.exe I can see the list (fx: track 1) but not it's contents. not sure how to do pixelsearch or controlget focus (yet)



thanks

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Rohwedder and 365 guests