-- detects if tablet is connected to notebook (run on notebook) get("#515") -- splitLines bla = os_backtick('usb-devices') lines = splitLines(bla) for _, line in ipairs(lines) do if line:match("S:%s+Manufacturer=SurfTab") then print("Tablet connected!") return end end print("Tablet not connected!")