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.
