Okay, I was able to do it through a process inspired by this post. basically, I put the anchor in the top right and then I just wrote some code:
marginright = getsetting("display/window/size/width") - desiredmargin
marginbottom = getsetting("display/window/size/height") - desiredmargin
desired margin is a variable with your desired margin. If it is changed all margins have to be set. I'm just putting this here in the hopes that somebody else finds it and also so that people know that I figured it out.