Is there a way to exactly position a window? I have a Quicktime window, and I would like to have it positioned at exactly (533,118). I have (painfully) achieved this using the Macbook's screenshot functionality (because it shows the coordinates of the cursor, so with a couple tries it can be done).

I know that windows normally remember their last position, but sometimes I need to move them to another location. It would be great if I could just input the desired coordinates.

I'm using macOS 10.13.
Here's an example AppleScript that sets the position of window 1 of Quick Time Player to {533, 118}, if it's running and the window exists.

if application "QuickTime Player" is running then
    try
        if (count windows of application "QuickTime Player") is greater than 0 then
            tell application "System Events" to set position of window 1 of application process "QuickTime Player" to {533, 118}
        end if
    end try
end if


This can be saved as a script or application or incorporated into an Automator workflow as a Service and assigned a keyboard shortcut, if you prefer.

Here's an example AppleScript that you can enter the {x, y} position info as a space separated value in a display dialog box:

if application "QuickTime Player" is running then
    try
        if (count windows of application "QuickTime Player") is greater than 0 then
            tell application "QuickTime Player"
                set theReply to (display dialog "Move window to position, e.g.: 533 118" default answer "533 118" buttons {"Cancel", "OK"} default button 2 with title "Enter Windows X Y Coordinates")
            end tell
            tell application "System Events" to set position of window 1 of application process "QuickTime Player" to {word 1 of text returned of theReply as integer, word 2 of text returned of theReply as integer}
        end if
    end try
end if


Note that you can set default answer "533 118" to default answer "", if you don't want a default value set.