Re: Best approach: Hotkey and Pasteboard application
Re: Best approach: Hotkey and Pasteboard application
- Subject: Re: Best approach: Hotkey and Pasteboard application
- From: Adam Holt <email@hidden>
- Date: Sat, 09 Apr 2005 11:50:57 +0100
Thanks Daniel for the reply and for the pointer to LSUIElement. I will go
and read up on it now.
It's a shame to have to forfeit the dock icon in the "foreground" state with
this app (I'm not worried about losing the menu bar). I hadn't really
noticed before you mentioned it, but Snapz Pro also exhibits the same
behaviour so presumably they have gone for a similar approach.
Best regards,
Adam.
On 9/4/05 1:59 am, "daniel" <email@hidden> wrote:
> I haven't used Snapz Pro, but I provide a similar behavior to what
> you're describing in my script menu utility, and the way it's done in
> general is to live the world "between background and foreground"
> applications. These apps are recognized by the OS as being capable of
> and allowed to displaying UI elements, but they don't have a visible
> bar. Search google or this list for "LSUIElement" and you should find
> some more information.
>
> There are some caveats to being an LSUIElement application, but in
> general you can take control of the UI just as any other app can, with
> the exception that you don't get a dock icon or a menu bar.
>
> Daniel
>
> On Apr 8, 2005, at 4:00 AM, Adam Holt wrote:
>
>> I'm trying to figure out the best approach to take with this...
>>
>> I want my application to run in the background (undocked) and when a
>> certain
>> global key combination is pressed, including a modifier key (e.g.
>> CMD-Escape) I want the GUI to appear and for the contents of the
>> Pasteboard
>> to be pasted into a NSTextView instance.
>>
>> I'm considering two general approaches to this:
>>
>> 1. Split this into two apps. Make the first one a background app that
>> can
>> be put in startup items. This is the app that listens for the hot key
>> event
>> and either launches, or brings to the front (if already running) my
>> second
>> app... similar to the application posted here: (
>> http://inessential.com/?comments=1&postid=2920 ). Whilst from this
>> example
>> I can see how to launch my second app I'm not sure of the best
>> approach to
>> take with the interapplication comms part, i.e. How do I send the
>> trigger to
>> my app2 to tell it to copy the pasteboard contents into the TextView?
>>
>> ALTERNATIVELY...
>>
>> 2. I put all of this inside one application. The closest example I can
>> think of is Snapz Pro ( http://www.ambrosiasw.com/utilities/snapzprox/
>> )
>> which runs as a background app when you launch it, until you hit the
>> hotkey
>> combination which then brings it to the foreground. I tried
>> recreating this
>> behaviour but failed. Does anybody have any examples of how this can
>> be
>> done?
>>
>>
>> I would certainly welcome your views on approach 1 vs approach 2 and
>> any
>> tips that anybody has about making either of these approaches work.
>>
>> Many thanks!
>>
>> Adam.
>>
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Cocoa-dev mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> sweater.com
>>
>> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden