View Single Post
Old 12-17-2018, 05:59 AM   #147
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

Quote:
Originally Posted by Edgemeal View Post
This seems to work OK, tho not sure its actually correct.

Code:
local hWnd_action = reaper.JS_Window_Find("Actions", true)
if hWnd_action ~= nil then
  -- Get handle to Filter editbox in Actions window,
  local hWnd_filter = reaper.JS_Window_FindChildByID(hWnd_action, 1324)
  -- send it an "A" Char
  ret = reaper.JS_WindowMessage_Post(hWnd_filter, "WM_CHAR", string.byte("A"), 0,0,0) 
end

Yes, simple characters work, but Ctrl+V etc do not.



Quote:
Code:
function JS_Send_Text(hWnd, str)
  for char in string.gmatch(str, "%U") do 
    ret = reaper.JS_WindowMessage_Post(hWnd, "WM_CHAR", string.byte(char), 0, 0, 0) 
    if ret ~= true then break end -- something went wrong?, abort loop!
  end
end

For some reason, this works up to 64 characters. If they are more than 64, it truncates the start.
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote