Move window to top right

I want to write a macro that takes a window of n width and moves it to the top right corner so that the entire window is onscreen, not resized; I know that i can move something to the left top corner easily enough, but without extracting the WIDTH from the size of a window, is there a way to do what I’m asking?



OK, I solved it already: I use this