Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

An application — iA Writer — somehow got stuck off screen with only the corner showing. I can't grab it or use other means to move it from that position.

All new windows open in that position, regardless of if I open/close the application.

Is there a terminal command for moving a specific window's position?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You can do it with AppleScript:

$ osascript \
    -e 'tell application "Terminal"' \
    -e 'set position of front window to {1, 1}' \
    -e 'end tell'

This isn't guaranteed to work. It's up to the app itself whether it will obey this command. You can try something like set bounds of front window to {1, 1, 800, 600} if it refuses to move the window. That will also resize it, but that might be a good thing, depending on how screwed up the window is.

I've broken the long command up purely for readability. It's fine to give it all as a single line, without the backslashes.

And yes, you need multiple -e options. AppleScript is a line-based language, so each line has to be given separately. You could run osascript without arguments and type the three lines by hand at it instead, if you prefer.

share|improve this answer
    
Hi Warren, Thanks. this gives me enough to play around with. –  wintour Jun 3 '12 at 5:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.