For some applications, such as Notes or VLC, you can use the following:
tell application "Notes" to get the bounds of the window 1
if I put the above line in a file and use sudo osascript thatfilename to call it, it works.
But for some applications, such as Angry Birds Space, the following will not work?
tell application "Angry Birds Space" to get the bounds of the window 1
with an error:
execution error: Angry Birds Space got an error: Can't get bounds of window 1. (-1728)
Is there anything special about this app that prevents it? (because it is a game or it does not have window 1?)
I am learning how to get and set bounds or just the width some window (only the width, since some window seems to have a specific aspect ratio, so I think it sets a certain width and the height may not work if the aspect ratio is wrong).
source share