Edgemeal has posted a code snippet on the forum for auto closing the popup after it opens (which is the best we can do from reascript). You have to find the right keyword to find it :P
EDIT:
Ok I found the code on my script folder but not the thread
Code:
function auto_trim()
local parent = reaper.JS_Window_FindTop('Auto trim/split items',true)
if parent then
local btn = reaper.JS_Window_FindChild(parent,"Process",true)
reaper.JS_WindowMessage_Send(btn, "WM_LBUTTONDOWN", 1, 0, 0, 0)
reaper.JS_WindowMessage_Send(btn, "WM_LBUTTONUP", 0, 0, 0, 0)
else
reaper.defer(auto_trim)
end
end
auto_trim()
reaper.JS_WindowMessage_Post(reaper.GetMainHwnd(), "WM_COMMAND", 40315,0,0,0)
Create a lua script from action list, and put the code in there, then CTRL+S.