Accurately resize a non - Cocoa Mac application

I intend to do some screencasts and afterwards post them to Vimeo, which has requirements of resolutions that will certainly generate excellent outcomes. Thus, I would love to have the ability to properly and also repeatably dimension the application window I am making a screencast from, to make the most effective use that room.

Googling the trouble, I thought of solutions like this:

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

I located that this method collaborates with some applications I attempted (such as Opera and also Firefox), yet not with both applications I intend to make screencasts from.

When I attempt it with "Scratch" instead of "Safari", I get

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

and also, I get a the very same mistake when I make use of "MINDSTORMS NXT" [the NXT - G shows language for Lego Mindstorms NXT ] instead of "Safari" (with the exception of the name of the application that created the mistake).

I assume, in both instances, that the mistake results from the reality that these are foreign (Cocoa) applications, yet constructed making use of cross - system collections. I additionally read that occasionally transforming the window number (ie. "2nd window", "3rd window") will certainly aid, yet it did not.

Currently after that, I actually do not require to recognize just how to do this in AppleScript, I simply desire a straightforward means to set the dimensions of a window for screencasting. Any person have a pointer?

2019-05-18 22:51:16
Source Share
Answers: 1

It is a kludge and also really hand-operated yet you can make use of a program like Xscope to establish the dimension and also placement and afterwards utilize it to aid you by hand place the window for your screencast.

The "Can't set bounds of window 1" usually suggests that the window does not exist when the manuscript was run. (eg. The window is in fact made by a subprocess that offers the real GUI) to make sure that might be the concern - or that the application overlooks any kind of and also all AppleScript occasions.

2019-05-30 05:53:42