[Pythonmac-SIG] how to avoid GUI launcher launching?
has
hengist.podd at virgin.net
Sun Oct 22 12:02:59 CEST 2006
On 22 Oct 2006, at 09:01, Ronald Oussoren wrote:
>> I'd really like to find a way to stop that annoying GUI launcher
>> starting up every time folk use appscript in Python 2.4+. [...]
>> What exactly
>> is the hair-trigger on that thing, and any ideas how I can suppress
>> it/route around it?
>
> You're using an API that causes the bouncing from an program in an
> application bundle (the embedded Python.app). Appearently some
> API's transform a process from a normal process to a GUI process if
> the program's binary is inside an application bundle.
System APIs, yes? Do you know if there's a way to find out which ones
do and which ones don't?
I'm currently using three Process Manager functions: GetNextProcess,
GetProcessBundleLocation and LaunchApplication. However, it should be
possible to use typeKernelProcessID in place of
typeProcessSerialNumber, so if anyone knows of PID-based equivalents
that don't trigger the transformation then I can modify appscript to
use those.
> Maybe this can be fixed by making Python.app a faceless
> application, although we should then thoroughly test if pythonw
> keeps working.
That might present a problem for any scripts that do need Python.app
to behave like a normal app, e.g. if it needs to show a menubar, or
users need to switch between processes. I don't know if there's any
way to make the facelessness bit conditional though, and even if
there was existing scripts would need to be updated to take advantage
of it. Reverting to the old python vs. pythonw split won't appeal to
anyone either (there's a reason they were merged, after all).
I think routing around the problem APIs in appscript is the best and
safest solution at this point. It's not an area I'm familiar with
though, so any advice will be much appreciated.
Many thanks,
has
--
http://freespace.virgin.net/hamish.sanderson/
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
More information about the Pythonmac-SIG
mailing list