From 06f226886294a972a0974c4e7b9ace306b05d491 Mon Sep 17 00:00:00 2001 From: BenTalagan Date: Sun, 3 Nov 2024 14:43:06 +0100 Subject: [PATCH] Forgot to check/prompt for JS's API --- ...track currently edited in active MIDI editor.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Various/talagan_Scroll TCP to track currently edited in active MIDI editor.lua b/Various/talagan_Scroll TCP to track currently edited in active MIDI editor.lua index 9c75ccbb5..8a959c025 100644 --- a/Various/talagan_Scroll TCP to track currently edited in active MIDI editor.lua +++ b/Various/talagan_Scroll TCP to track currently edited in active MIDI editor.lua @@ -20,6 +20,19 @@ (scroll, resize, fit, etc). --]] +local function CheckReapack(func_name, api_name, search_string) + if not reaper.APIExists(func_name) then + local answer = reaper.MB( api_name .. " is required and you need to install it.\z + Right-click the entry in the next window and choose to install.", + api_name .. " not installed", 0 ) + reaper.ReaPack_BrowsePackages( search_string ) + return false + end + return true +end + +if not CheckReapack("JS_ReaScriptAPI_Version", "JS_ReaScriptAPI", "js_ReaScriptAPI") then return end + -- Using X-Raym's X-Raym_Scroll vertically to first selected track.lua -- Thanks Raymond !