Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Oct 22, 2010, 11:41 AM   #1
vadym.hulakov
macrumors newbie
 
Join Date: Oct 2010
Change position of another app's window

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().
vadym.hulakov is offline   0 Reply With Quote
Old Oct 22, 2010, 02:25 PM   #2
ulbador
macrumors 68000
 
ulbador's Avatar
 
Join Date: Feb 2010
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.
ulbador is offline   0 Reply With Quote
Old Oct 23, 2010, 05:25 AM   #3
vadym.hulakov
Thread Starter
macrumors newbie
 
Join Date: Oct 2010
Quote:
Originally Posted by ulbador View Post
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?
vadym.hulakov is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
What angle do you position your Macbook/screen to your window/light source ? XPcentric Mac Basics and Help 1 Feb 24, 2014 03:23 PM
iPhone: Anybody know how to change the size/position of lockscreen album artwork? lewisweekly Jailbreaks and iOS Hacks 0 Oct 13, 2013 08:00 AM
iPhone: Can anyone help me work out how to change the position of a widget? Xenochria Jailbreaks and iOS Hacks 0 Mar 14, 2013 05:17 PM
Mail window position jayducharme OS X 10.8 Mountain Lion 0 Jul 29, 2012 03:00 PM
Window Position in Mail Vegasryn Mac OS X 10.7 Lion 0 May 31, 2012 12:21 PM

Forum Jump

All times are GMT -5. The time now is 04:08 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC