forked from ReaTeam/ReaScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release Deselect odd-numbered items from selected items v1.0 (ReaTeam…
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
Items Editing/kkkanten_Deselect odd-numbered items from selected items.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
-- @description Deselect odd-numbered items from selected items | ||
-- @author KKKANTEN | ||
-- @version 1.0 | ||
-- @about | ||
-- タイトルの通り、複数選択したアイテムの奇数番目の選択を解除するスクリプトです。 | ||
-- アイテムを複数選択し、実行してください。 | ||
-- | ||
-- As the title suggests, this script deselects the odd-numbered items of multiple selected items. | ||
-- Please select multiple items and execute. (machine translate) | ||
|
||
local UNDO_STATE_ITEMS = 4 | ||
|
||
reaper.Undo_BeginBlock() | ||
reaper.PreventUIRefresh(1) | ||
for i = reaper.CountSelectedMediaItems(nil) - 1 & ~1, 0, -2 do | ||
local item = reaper.GetSelectedMediaItem(nil, i) | ||
reaper.SetMediaItemSelected(item, false) | ||
end | ||
reaper.UpdateArrange() | ||
reaper.PreventUIRefresh(-1) | ||
reaper.Undo_EndBlock('Deselect odd-numbered items from selected items', UNDO_STATE_ITEMS) |