Try changing

$R.AcceptsTab = true

to...

$R.AcceptsTab = 1