Re: [Pythonmac-SIG] Opening an app from another app under different OS X versions
On 25-Jan-07, at 12:08 AM, Ronald Oussoren wrote: > On 24 Jan, 2007, at 18:44, Dethe Elza wrote: > >> Also, paths are different on >> internationalized versions of OS X. > > The aren't AFAIK. The finder is localized and shows different > folder names if you run in another language (that's why there are > ".localized" turds in several directories). Windows is the OS where > directory names actually do change depending on the language you > install it in. > > The OSX implementation actually makes it possible to have several > accounts with different languages and have them all see their > localized version of folder names. Cool, I didn't know that. I'm pretty sure older versions of Mac OS (pre-OS X) *did* work that way--you had to use symbolic constants to refer to known folders and not count on the exact file paths. That said, using fully-qualified paths can still be fragile, since users may move things around when you least expect it. --Dethe "There's a little bit of God in every truck driver and a little bit of truck driver in every God." -- Blayne Horner ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Opening an app from another app under different OS X versions
On 24 Jan, 2007, at 18:44, Dethe Elza wrote: Also, paths are different on internationalized versions of OS X. The aren't AFAIK. The finder is localized and shows different folder names if you run in another language (that's why there are ".localized" turds in several directories). Windows is the OS where directory names actually do change depending on the language you install it in. The OSX implementation actually makes it possible to have several accounts with different languages and have them all see their localized version of folder names. --Dethe You need to lay out the user interface components visually, by hand, with total control over where they go. Automated LayoutManagers don’t cut it. A corollary of this is that you can’t move a UI layout from one platform to another and have the computer make everything fit. Computers don’t lay out interfaces by themselves any better than they can translate French to English by themselves. -- Jens Alfke +1 smime.p7s Description: S/MIME cryptographic signature ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Opening an app from another app under different OS X versions
As Kevin said, you may only need the full path to your app. It's remotely possible you would need the full path to open as well (/usr/ bin/open). Full paths are finicky though, and you will need to know where your application is installed, if the help application is in the app bundle, for instance. Also, paths are different on internationalized versions of OS X. The right way is probably to use PyObjC and the NSWorkspace object: from AppKit import NSWorkspace NSWorkspace.sharedWorkspace.launchApplication_('MyApp') For more on Workspace services, there is this article: file:/// Developer/ADC%20Reference%20Library/documentation/Cocoa/Conceptual/ Workspace/index.html Also, when you're launching an app with open, you don't need the -a flag, but without it you do need the path to the application. --Dethe You need to lay out the user interface components visually, by hand, with total control over where they go. Automated LayoutManagers don’t cut it. A corollary of this is that you can’t move a UI layout from one platform to another and have the computer make everything fit. Computers don’t lay out interfaces by themselves any better than they can translate French to English by themselves. -- Jens Alfke ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Opening an app from another app under different OS X versions
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David Woods wrote: > My wxPython application has a context sensitive help system, using > wx.html.HtmlHelpController(), which also contains a Tutorial for the > program. Users like to leave the Help window open while they are > simultaneously working in the application. To allow this, I set the Help > application up as a free-standing application that I can call from my > regular application when it is needed. (This is necessary because of issues > with menu construction.) My applications are built using py2app, so the > call I've been using looks like this: > > os.system('open -a TransanaHelp.app') > > This works on OS X 10.3, and it works when I'm running under Python on OS X > 10.4, but I have not been able to get anything along these lines to work > under OS X 10.4 once my app has been bundled up with py2app. It's like the > Help app tries to launch, but then it immediately, and silently, shuts down. > (i.e. the Console doesn't report anything.) os.spawnv() and > os.popen2() don't work either. Does anybody have any ideas for how I can > launch a bundled wxPython app from within another bundled wxPython app on OS > X 10.4? > > Thanks for your help, > > David K. Woods, Ph.D. > Transana Lead Developer > Wisconsin Center for Education Research > University of Wisconsin, Madison > http://www.transana.org > > ___ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > Where is the help application bundled? Alongside the main app in the same directory, or inside the main app's application bundle itself? Perhaps it's a path issue, i.e. 'open' can't find the app to open. If so, you may need to do some work to get a full path to the help app, then launch it (i.e., os.system('open -a /path/to/myapp.app') ). - -- Kevin Walzer Code by Kevin http://www.codebykevin.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFt4gOEsLm8HXyq4sRAur4AJ9u3vKlXLEldALsil/IdcuUE2/8UwCeKFxo UwGgrIA4fvwU+FA2OjtrPg0= =dyGm -END PGP SIGNATURE- ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Opening an app from another app under different OS X versions
My wxPython application has a context sensitive help system, using wx.html.HtmlHelpController(), which also contains a Tutorial for the program. Users like to leave the Help window open while they are simultaneously working in the application. To allow this, I set the Help application up as a free-standing application that I can call from my regular application when it is needed. (This is necessary because of issues with menu construction.) My applications are built using py2app, so the call I've been using looks like this: os.system('open -a TransanaHelp.app') This works on OS X 10.3, and it works when I'm running under Python on OS X 10.4, but I have not been able to get anything along these lines to work under OS X 10.4 once my app has been bundled up with py2app. It's like the Help app tries to launch, but then it immediately, and silently, shuts down. (i.e. the Console doesn't report anything.) os.spawnv() and os.popen2() don't work either. Does anybody have any ideas for how I can launch a bundled wxPython app from within another bundled wxPython app on OS X 10.4? Thanks for your help, David K. Woods, Ph.D. Transana Lead Developer Wisconsin Center for Education Research University of Wisconsin, Madison http://www.transana.org ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig