Cannot get or set the window size of some apps using AppleScript?

Viewed 9907

For some apps, such as Notes, or VLC, the following can be used:

tell application "Notes" to get the bounds of the window 1

if I put the above line into a file and use sudo osascript thatfilename to invoke it, it works.

But for some apps such as the Angry Birds Space, the following will not work?

tell application "Angry Birds Space" to get the bounds of the window 1

giving an error:

execution error: Angry Birds Space got an error: Can’t get bounds of 
  window 1. (-1728)

Is there something special of that app that prevents it? (because it is a game or does it not have window 1?)

I am looking into getting and setting the bounds or just the width of some window (just the width as some window seem to have to have a specific aspect ratio, so I think setting it to a specific width and height may not work if the aspect ratio isn't correct).

2 Answers
Related