Below is a script spk77 made that I use all the time for making items behave as if they are grouped if they're in a folder (it's my default click select).
The first refinement I'd like to make is this: If I click an item that is shorter than other parallel items in the folder then only the items that start and end in exactly the same place as the short one are selected in the folder.
The second refinement is that if I click an item in the folder and there are several shorter items within it's length on other tracks in the folder, then all the items within the start and end points of the selected item on the other tracks are selected.
Thirdly if I click an item that is shorter than some parallel items but longer than others within it's own length then both the above rules apply to the various length items comparatively (selecting the item I click, not any longer ones but include other items within the length of the item I've clicked that are on parallel tracks in the folder.
Phew!
Any clarification needed? Shout me!
Many thanks
Code:
Undo_BeginBlock2(0);
last_touched_track = GetLastTouchedTrack();
i = 0;
cur_depth = 0;
is_child_track = 0;
tr_c = CountTracks(0);
while(is_child_track == 0 && i < tr_c) (
track = GetTrack(0, i);
depth_change = GetMediaTrackInfo_Value(track, "I_FOLDERDEPTH");
cur_depth += depth_change;
track == last_touched_track && depth_change <= 0 && cur_depth >= 0 ? is_child_track = 1;
cur_depth == 0 && depth_change == 0 ? is_child_track = 0;
i += 1;
);
PreventUIRefresh(1);
is_child_track == 1 ? (
Main_OnCommand(NamedCommandLookup("_SWS_SELPARENTS2"), 0);
Main_OnCommand(NamedCommandLookup("_SWS_SELCHILDREN"), 0); // sel only children tracks
Main_OnCommand(NamedCommandLookup("_XENAKIOS_SELITEMSUNDEDCURSELTX"), 0);
) : SetOnlyTrackSelected(last_touched_track);
PreventUIRefresh(-1);
Undo_EndBlock2(0, "Select items under edit cursor (in a folder)", -1);