From ea4bc1614be597c33bf364a15dd3e30ab90161f7 Mon Sep 17 00:00:00 2001 From: milAgar / KKKANTEN <149487793+milAgarr@users.noreply.github.com> Date: Tue, 16 Jan 2024 21:04:35 +0900 Subject: [PATCH] Release Deselect odd-numbered items from selected items v1.0 (#1296) --- ...odd-numbered items from selected items.lua | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Items Editing/kkkanten_Deselect odd-numbered items from selected items.lua diff --git a/Items Editing/kkkanten_Deselect odd-numbered items from selected items.lua b/Items Editing/kkkanten_Deselect odd-numbered items from selected items.lua new file mode 100644 index 000000000..0ce67d2c6 --- /dev/null +++ b/Items Editing/kkkanten_Deselect odd-numbered items from selected items.lua @@ -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)