If you save this as ReaperSendEnter.vbs in the same folder as the Lua script.
Code:
Set Processes = GetObject("winmgmts:").InstancesOf("Win32_Process")
For Each Process In Processes
If StrComp(Process.Name, "reaper.exe", vbTextCompare) = 0 Then
' Activate the window using its process ID...
With CreateObject("WScript.Shell")
.AppActivate Process.ProcessId
.SendKeys "{ENTER}"
End With
' We found our process. No more iteration required...
Exit For
End If
Next
In your Lua script add
Code:
local info = debug.getinfo(1,'S');
script_path = info.source:match[[^@?(.*[\/])[^\/]-$]]
reaper.CF_ShellExecute(script_path .. "ReaperSendEnter.vbs")
and see if it works.
EDIT: you can also create an apple script for Mac.