In your example, it seems that you’re giving focus to inventory window rather than the context menu. It’s hard to tell how you scripted it, I might have misunderstood the intent here.