View Single Post
Old 05-20-2019, 09:51 AM   #19
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

Possible workaround script to toggle Actions window, whether docked or not,...

Code:
function Main()
  local found = false
  local arr = reaper.new_array({}, 100)
  local title = reaper.JS_Localize("Actions", "common")
  reaper.JS_Window_ArrayFind(title, true, arr)
  local adr = arr.table() 
  for j = 1, #adr do
    local hwnd = reaper.JS_Window_HandleFromAddress(adr[j])
    if reaper.JS_Window_FindChildByID(hwnd, 1323) then -- verify window, must also have control ID#.
      reaper.JS_Window_Destroy(hwnd) -- close action list
      found = true
      break
    end 
  end 
  if not found then reaper.ShowActionList() end -- show action list
end

if not reaper.APIExists('JS_Localize') then
  reaper.MB("js_ReaScriptAPI extension is required for this script.", "Missing API", 0)
else
  Main()
end
reaper.defer(function () end)

Last edited by Edgemeal; 05-20-2019 at 12:41 PM. Reason: var names
Edgemeal is offline   Reply With Quote