Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

vadym.hulakov

macrumors newbie
Original poster
Oct 22, 2010
2
0
I am using python and pyobjc. I need to change position of another app's window.

Information I have is title of window. Also I can get window number by using Quartz.CGWindowListCopyWindowInfo().
 

ulbador

macrumors 68000
Feb 11, 2010
1,554
0
As the "quick and dirty way", I would probably just call a shell script. You just would execute the command "osascript". You can make osascript tell the application or even the Finder to close or move windows.
 

vadym.hulakov

macrumors newbie
Original poster
Oct 22, 2010
2
0
As the "quick and dirty way", I would probably just call a shell script. You just would execute the command "osascript". You can make osascript tell the application or even the Finder to close or move windows.

I think that "quick and dirty way" is ok for this case. But I have problems with osascript. I use command:

osascript -e 'tell application "FooApp" set bounds of window 1 to {100, 100, 500, 500}'

I get error "execution error: FooApp got an error: Can't set bounds of window 1 to {100, 100, 500, 500}. (-10006).

Interesting that this command work fine for TextEdit

osascript -e 'tell application "TextEdit" set bounds of window 1 to {100, 100, 500, 500}'

What do I need to do make my application compatible with osascript?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.