Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to do some screencasts and then upload them to Vimeo, which has specifications of resolutions that will yield good results. As such, I would like to be able to accurately and repeatably size the application window I am making a screencast from, to make the best use of that space.

Googling the problem, I came up with answers like this:

tell application "Safari"
  activate
  set the bounds of the first window to {140, 0, 1160, 775}
end tell

I found that this method works with some applications I tried (such as Opera and Firefox), but not with the two applications I want to make screencasts from.

When I try it with "Scratch" in place of "Safari", I get

AppleScript Error
Scratch got an error: Can’t set bounds of window 1 to {140, 0, 1160, 775}.

and, I get a the same error when I use "MINDSTORMS NXT" [the NXT-G programming language for Lego Mindstorms NXT] in place of "Safari" (except for the name of the application that caused the error).

I presume, in both cases, that the error is due to the fact that these are not native (Cocoa) apps, but built using cross-platform libraries. I also read that sometimes changing the window number (ie. "second window", "third window") will help, but it did not.

Now then, I really don't need to know how to do this in AppleScript, I just want a simple way to set the dimensions of a window for screencasting. Anyone have a tip?

share|improve this question
add comment

1 Answer

It's a kludge and very manual but you could use a program like Xscope to determine the size and position and then use it to help you manually position the window for your screencast.

The "Can't set bounds of window 1" often means that the window doesn't exist when the script was run. (eg. The window is actually made by a subprocess that gives the actual GUI) so that may be the issue - or that the application ignores any and all AppleScript events.

share|improve this answer
add comment

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.