what user does a PreferencePane run as?

2009-06-30 Thread Bill Janssen
I'm working on a system prefs pref pane for my application. I'd like to have it read the user's preferences for that application, but I can't find out where it says what user the System Preferences application runs as, and how to control that, or whether that's possible. Bill

Re: what user does a PreferencePane run as?

2009-06-30 Thread Bill Janssen
n Tuesday, June 30, 2009, at 08:01PM, "Bill Janssen" > wrote: > >I'm working on a system prefs pref pane for my application. I'd like to > >have it read the user's preferences for that application, but I can't > >find out where it says what

what does LSUIElement really do?

2009-02-03 Thread Bill Janssen
Over in the Mac-Python world, we're wondering whether /System/Library/Frameworks/Python.framework/Resources/Python.app might benefit from having LSBackgroundOnly or LSUIElement set in its Info.plist. It seems to me that both of these settings allow access to the window system and other frameworks,

Re: what does LSUIElement really do?

2009-02-03 Thread Bill Janssen
Mark Munz wrote: > LSUIElement allows you to link to AppKit and connect to the > WindowServer. That means you can create floating windows, system > menus, etc.. Or UI elements -- as the name suggestions. > > I believe LSBackgroundOnly is more limited in user interaction, > although it works well

How to prompt for admin rights in Cocoa-Python?

2008-10-21 Thread Bill Janssen
I'm writing a little uninstaller app in Cocoa-Python, and I need to put up that ubiquitous OS X prompt for the admin password, then elevate the privileges of the script to remove some directories installed as root. Is that a standard widget? If so, what is it? If not, what's the standard dance to

enumerating the NSApplication instances?

2008-10-23 Thread Bill Janssen
Hi. I'm trying to write a simple Cocoa program to enumerate the windows on the screen, across all the apps. I can see how to use NSWorkspace.launchedApplications() to enumerate the apps, but I don't see how to go from those dictionaries to an instance of NSApplication, so that I can enumerate the

Re: enumerating the NSApplication instances?

2008-10-23 Thread Bill Janssen
Charles Steinman <[EMAIL PROTECTED]> wrote: > You can't get NSApplication instances for other applications. Even as root? Bill ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list

Using Cocoa with Spaces?

2008-11-18 Thread Bill Janssen
Is there an Objective-C interface to Spaces? I've got a NSStatusItem that pops up an NSWindow when you click on it. I'd like that window to come up in the current Space, not the Space it was in when it was started, or the space it was in the last time it popped up that NSWindow. Is there some in

what does FAILED TO GET ASN FROM CORESERVICES mean?

2008-11-22 Thread Bill Janssen
[I originally sent this, erroneously, to darwin-development. It's failing in NSApplication.init(), so it belongs here. -- wcj] What's an "ASN"? How does a system daemon ever get one? I'm running a daemon, started by SystemStarter at boot time, and running as me (an admin account), which period

Re: what does FAILED TO GET ASN FROM CORESERVICES mean?

2008-11-25 Thread Bill Janssen
hed in the context of that user's GUI login process. Bill Sherm Pendley <[EMAIL PROTECTED]> wrote: > On Nov 22, 2008, at 4:20 PM, Bill Janssen wrote: > > > > What's an "ASN"? How does a system daemon ever get one? > > > > I'm running a d

Re: what does FAILED TO GET ASN FROM CORESERVICES mean?

2008-11-25 Thread Bill Janssen
Kyle Sluder <[EMAIL PROTECTED]> wrote: > On Sat, Nov 22, 2008 at 4:20 PM, Bill Janssen <[EMAIL PROTECTED]> wrote: > > I'm running a daemon, started by SystemStarter at boot time, and running > > as me (an admin account), which periodically invokes OpenOffice'

Adding an application to the login items

2008-12-03 Thread Bill Janssen
I'm writing an installer that adds an application to the login items, but my script (see below) keeps failing, with a bus error, like this: Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x Crashed Thread: 0 Thread 0 Crashed: 0 com.apple.Co

Re: Adding an application to the login items

2008-12-03 Thread Bill Janssen
Jason Coco <[EMAIL PROTECTED]> wrote: > > I'm writing an installer that adds an application to the login items, > > but my script (see below) keeps failing, with a bus error, like this: > > You're dereferencing a null pointer. Assert that url is not null after > CFURLRef.alloc()... returns. I

building a custom NSView with IB?

2008-12-08 Thread Bill Janssen
I'd like to build a custom view that is just an assemblage of an NSTextView, a couple of pushbuttons, and a checkbox. It seems to me that there should be some way to do this with IB, but I haven't figured it out yet. All the examples on the net seem to focus on overriding drawRect, which I *don't

Re: building a custom NSView with IB?

2008-12-08 Thread Bill Janssen
Corbin Dunn <[EMAIL PROTECTED]> wrote: > > I'd like to build a custom view that is just an assemblage of an > > NSTextView, a couple of pushbuttons, and a checkbox. It seems to me > > that there should be some way to do this with IB, but I haven't > > figured > > it out yet. All the examples on

using QuickLook from an application?

2009-03-12 Thread Bill Janssen
I'd like to be able to invoke the QuickLook server from my application to obtain PDF or RTF preview versions of MS-Office Documents before opening them. The capability exists; you can see it in Finder, for instance. But I can't see how to invoke it from a client. The only useful call I can make

Re: using QuickLook from an application?

2009-03-12 Thread Bill Janssen
Julien Jalon wrote: > > I'd like to be able to invoke the QuickLook server from my application > > to obtain PDF or RTF preview versions of MS-Office Documents before > > opening them. The capability exists; you can see it in Finder, for > > instance. But I can't see how to invoke it from a cli

Re: using QuickLook from an application?

2009-03-12 Thread Bill Janssen
Bill Janssen wrote: > Julien Jalon wrote: > > Please file a radar and explain precisely what you want. > > I'll do that. Basically, the idea is that having access to simplified > standardized renditions of various document formats is very useful for > purposes oth

stopping an application

2009-04-12 Thread Bill Janssen
What's the right way to have another process stop an application? Sending a SIGTERM doesn't seem to invoke the application shutdown dance; and signal handlers don't seem to establish themselves. Bill ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.co

Re: stopping an application

2009-04-12 Thread Bill Janssen
Nick Zitzmann wrote: > > On Apr 12, 2009, at 11:21 AM, Bill Janssen wrote: > > > What's the right way to have another process stop an application? > > > Send it the "quit" Apple event. > > Nick Zitzmann > <http://www.chronosnet.com/> I

Re: stopping an application

2009-04-13 Thread Bill Janssen
Nick Zitzmann wrote: > > On Apr 12, 2009, at 7:48 PM, Bill Janssen wrote: > > > I was afraid of that... Is there an easy way to do that from the > > command line given its PID? > > > Not really. First, you need a window server connection; you cannot > send

Re: stopping an application

2009-04-13 Thread Bill Janssen
Greg Guerin wrote: > Bill Janssen wrote: > > > I was afraid of that... Is there an easy way to do that from the > > command line given its PID? > > Use the osascript command. > > Form a query using a 'whose' clause to select the process ID. I > f

Re: stopping an application

2009-04-13 Thread Bill Janssen
James W. Walker wrote: > tell app "System Events" to set x to file of first process whose unix > id is 902 > tell app (POSIX path of x) to quit Thanks, that "unix id is xxx" was what I was looking for. > Hmm, now what did this have to do with Cocoa? I didn't have to do this till I started usin

Re: stopping an application

2009-04-13 Thread Bill Janssen
"From the command line"... Luca C. wrote: > 2009/4/13 Bill Janssen > > > > > > I was afraid of that... Is there an easy way to do that from the > > command line given its PID? > > > Using an AppleEvent given the appropriate bundle id of the appl

losing focus momentarily, over and over again

2009-05-07 Thread Bill Janssen
I'm losing focus, momentarily, over and over again, and I'd like to figure out whether there's anything I can do about it. I'm running a number of apps against the window server, like Cocoa Emacs and Camino. I run a background process that watches (via Applescript calls to System Events) what's g