Last active
February 24, 2019 12:02
-
-
Save cfillion/34701ce5ff1baa9e25b9533204c765f3 to your computer and use it in GitHub Desktop.
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
function checkJSAPI(requiredVersion) | |
if reaper.JS_ReaScriptAPI_Version and reaper.JS_ReaScriptAPI_Version() >= requiredVersion then | |
return true | |
end | |
local button = reaper.MB(string.format([[ | |
This script requires js_ReaScriptAPI %s or newer. Do you want to install it now? | |
Choose [Yes] to open ReaPack's package browser. | |
]], requiredVersion), "js_ReaScriptAPI not found", 4) | |
if button == 6 then | |
reaper.ReaPack_BrowsePackages('js_ReascriptAPI') | |
end | |
return false | |
end | |
if not checkJSAPI(0.961) then | |
return reaper.defer(function() end) | |
end | |
doSomething() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment