Adding to an applications menu.

  • This should be an easy question.

    I need to add a new item under the "Go" menu in the OS X Finder.  My
    client has stipulated this, otherwise I would not do so.  I have
    tried to talk them out of it, but so far no luck.

    I have edited the objects.xib file contained in /System/Library/
    CoreService/Finder.App/Contents/Resources/English.lproj/Menus.nib/.

    I added my new entries in there, picked an ID that did not appear to
    be used (716), assigned a key, but what do I do with the "command"
    entry?  If I leave it as is, it launches the command I copied instead
    of doing something I want.  I assume there is some listener that is
    catching all events generated by the menu.  Can I hook into that in
    some way?

    Is it possible to register a command to launch a specific application
    on the machine?  Or launch a specific path?

    I cannot seem to figure that part out.

    My experience in Cocoa is limited.

    Any suggestions on this?

    Is it possible?

    Thanks,
    Ben
  • On 03 Sep 07, at 01:41, Ben Spink wrote:
    > This should be an easy question.

    To be brief: it's not.

    > I need to add a new item under the "Go" menu in the OS X Finder.
    > My client has stipulated this, otherwise I would not do so.  I have
    > tried to talk them out of it, but so far no luck.
    >
    > I have edited the objects.xib file contained in /System/Library/
    > CoreService/Finder.App/Contents/Resources/English.lproj/Menus.nib/.
    >
    > I added my new entries in there, picked an ID that did not appear
    > to be used (716), assigned a key, but what do I do with the
    > "command" entry?  If I leave it as is, it launches the command I
    > copied instead of doing something I want.  I assume there is some
    > listener that is catching all events generated by the menu.  Can I
    > hook into that in some way?
    >
    > Is it possible to register a command to launch a specific
    > application on the machine?  Or launch a specific path?

    Unless you have access to the Finder source code - which I'm pretty
    sure you don't - you can't add commands. If the Finder is working
    anything like the programs which I've been familiar with, those IDs
    are being handled in a big switch() statement (or something similar)
    deep within its code.

    So no: there's no way you can edit the Finder's interface. And you
    definitely shouldn't - Apple reserves the right to change the way it
    works internally, and in fact I'm pretty certain[1] that under
    Leopard, the Finder will work entirely differently. (Everything I've
    heard has suggested that it's been heavily rearchitected, and there's
    a significant chance it's no longer even using Carbon anymore.)

    [1] Based on what I've seen on Apple's web site, nothing more.
  • i think you can't do anything without code injection here... maybe you
    should try Application Enhancer from Unsanity, or try to go with an
    inputmanager, which don't work under 10.5 though... another way is the
    Mach* bundle which you could also try.

    anyway, what you have to do is get a bundle loaded in finder and in
    this bundle you can add something to this menu, or change some
    implementations.... if Finder has a plugin architecture this should be
    pretty easy, but i guess it doesn't.

    I think there's a project to add svn support to finder, they use Mach*
    so maybe that's a start

    Kind Regards
    Karsten

    Am 03.09.2007 um 10:41 schrieb Ben Spink:

    > This should be an easy question.
    >
    > I need to add a new item under the "Go" menu in the OS X Finder.  My
    > client has stipulated this, otherwise I would not do so.  I have
    > tried to talk them out of it, but so far no luck.
    >
    > I have edited the objects.xib file contained in /System/Library/
    > CoreService/Finder.App/Contents/Resources/English.lproj/Menus.nib/.
    >
    > I added my new entries in there, picked an ID that did not appear to
    > be used (716), assigned a key, but what do I do with the "command"
    > entry?  If I leave it as is, it launches the command I copied
    > instead of doing something I want.  I assume there is some listener
    > that is catching all events generated by the menu.  Can I hook into
    > that in some way?
    >
    > Is it possible to register a command to launch a specific
    > application on the machine?  Or launch a specific path?
    >
    > I cannot seem to figure that part out.
    >
    > My experience in Cocoa is limited.
    >
    > Any suggestions on this?
    >
    > Is it possible?
    >
    > Thanks,
    > Ben
    >
    >
  • On Sep 3, 2007, at 1:41 AM, Ben Spink wrote:

    > Any suggestions on this?

    Don't attempt to do that.

    > Is it possible?

    No. Not in any maintainable supported way.

    -Shawn
  • What exactly are you trying to do? Could you do this with a Finder
    Context menu? If you tell us what you are trying to do, maybe we can
    help you find a way around this that you can present to you client.

    On Sep 3, 2007, at 2:41 AM, Ben Spink wrote:

    > This should be an easy question.
    >
    > I need to add a new item under the "Go" menu in the OS X Finder.
    > My client has stipulated this, otherwise I would not do so.  I have
    > tried to talk them out of it, but so far no luck.
    >
    > I have edited the objects.xib file contained in /System/Library/
    > CoreService/Finder.App/Contents/Resources/English.lproj/Menus.nib/.
    >
    > I added my new entries in there, picked an ID that did not appear
    > to be used (716), assigned a key, but what do I do with the
    > "command" entry?  If I leave it as is, it launches the command I
    > copied instead of doing something I want.  I assume there is some
    > listener that is catching all events generated by the menu.  Can I
    > hook into that in some way?
    >
    > Is it possible to register a command to launch a specific
    > application on the machine?  Or launch a specific path?
    >
    > I cannot seem to figure that part out.
    >
    > My experience in Cocoa is limited.
    >
    > Any suggestions on this?
    >
    > Is it possible?
    >
    > Thanks,
    > Ben
    >
  • I have presented alternate method to then that i think would work
    well.  However they are currently sticking to their requirement that
    it must be an additional menu under the Finder's "Go" menu.

    I even thought about making a fake menu there, and having the real
    menu be a service application under the services menu.  So by
    selecting the Finder menu, it would really trigger the service menu.
    Is this possible?

    I was just hoping to edit a nib file, point it to a different action,
    etc.

    I don't like the idea of doing this, I am just trying to satisfy
    their requirement.  They have heard my issues, but still have not
    budged on the requirement so far. :(

    Thanks,
    Ben

    On Sep 3, 2007, at 9:45 AM, development2 wrote:

    > What exactly are you trying to do? Could you do this with a Finder
    > Context menu? If you tell us what you are trying to do, maybe we
    > can help you find a way around this that you can present to you
    > client.
    >
    >
    > On Sep 3, 2007, at 2:41 AM, Ben Spink wrote:
    >
    >> This should be an easy question.
    >>
    >> I need to add a new item under the "Go" menu in the OS X Finder.
    >> My client has stipulated this, otherwise I would not do so.  I
    >> have tried to talk them out of it, but so far no luck.
    >>
    >> I have edited the objects.xib file contained in /System/Library/
    >> CoreService/Finder.App/Contents/Resources/English.lproj/Menus.nib/.
    >>
    >> I added my new entries in there, picked an ID that did not appear
    >> to be used (716), assigned a key, but what do I do with the
    >> "command" entry?  If I leave it as is, it launches the command I
    >> copied instead of doing something I want.  I assume there is some
    >> listener that is catching all events generated by the menu.  Can I
    >> hook into that in some way?
    >>
    >> Is it possible to register a command to launch a specific
    >> application on the machine?  Or launch a specific path?
    >>
    >> I cannot seem to figure that part out.
    >>
    >> My experience in Cocoa is limited.
    >>
    >> Any suggestions on this?
    >>
    >> Is it possible?
    >>
    >> Thanks,
    >> Ben
    >>
  • On Sep 3, 2007, at 8:51 AM, Ben Spink wrote:

    > I have presented alternate method to then that i think would work
    > well.  However they are currently sticking to their requirement
    > that it must be an additional menu under the Finder's "Go" menu.
    >
    > I even thought about making a fake menu there, and having the real
    > menu be a service application under the services menu.  So by
    > selecting the Finder menu, it would really trigger the service
    > menu.  Is this possible?

    No. What is it you are trying to do exactly? This may help us, help you.

    >
    > I was just hoping to edit a nib file, point it to a different
    > action, etc.
    >
    > I don't like the idea of doing this, I am just trying to satisfy
    > their requirement.  They have heard my issues, but still have not
    > budged on the requirement so far. :(

    Well I know I have had clients and employers like this also, it is a
    tough situation, but this is not possible to do. So if you could tell
    us exactly what you are trying to accomplish we may be able to give
    you alternatives that maybe they could live with.

    >
    > Thanks,
    > Ben
    >
    > On Sep 3, 2007, at 9:45 AM, development2 wrote:
    >
    >> What exactly are you trying to do? Could you do this with a Finder
    >> Context menu? If you tell us what you are trying to do, maybe we
    >> can help you find a way around this that you can present to you
    >> client.
    >>
    >>
    >> On Sep 3, 2007, at 2:41 AM, Ben Spink wrote:
    >>
    >>> This should be an easy question.
    >>>
    >>> I need to add a new item under the "Go" menu in the OS X Finder.
    >>> My client has stipulated this, otherwise I would not do so.  I
    >>> have tried to talk them out of it, but so far no luck.
    >>>
    >>> I have edited the objects.xib file contained in /System/Library/
    >>> CoreService/Finder.App/Contents/Resources/English.lproj/Menus.nib/.
    >>>
    >>> I added my new entries in there, picked an ID that did not appear
    >>> to be used (716), assigned a key, but what do I do with the
    >>> "command" entry?  If I leave it as is, it launches the command I
    >>> copied instead of doing something I want.  I assume there is some
    >>> listener that is catching all events generated by the menu.  Can
    >>> I hook into that in some way?
    >>>
    >>> Is it possible to register a command to launch a specific
    >>> application on the machine?  Or launch a specific path?
    >>>
    >>> I cannot seem to figure that part out.
    >>>
    >>> My experience in Cocoa is limited.
    >>>
    >>> Any suggestions on this?
    >>>
    >>> Is it possible?
    >>>
    >>> Thanks,
    >>> Ben
    >>>
    >
    >
  • On Sep 3, 2007, at 7:51 AM, Ben Spink wrote:

    > I was just hoping to edit a nib file, point it to a different
    > action, etc.

    On 10.5 this will causing your customers grief (cannot say more
    because of NDA). This is simply not an option.

    -Shawn
  • Under the Finder's Go, iDisk menu, they want a link to launch an
    email with instructions for connecting to the idisk.  This would be
    handled by Applescript, and I have no issue doing that provided I can
    get the app to launch.

    The second one is they want the idisk "Connect to:" url copied to the
    clipboard.  This too I was going to do with applescript, provided I
    can get it to launch.

    That's it.  Launch two different applications, from two separate menu
    items.

    Thanks,
    Ben

    On Sep 3, 2007, at 10:01 AM, development2 wrote:

    >
    > On Sep 3, 2007, at 8:51 AM, Ben Spink wrote:
    >
    >> I have presented alternate method to then that i think would work
    >> well.  However they are currently sticking to their requirement
    >> that it must be an additional menu under the Finder's "Go" menu.
    >>
    >> I even thought about making a fake menu there, and having the real
    >> menu be a service application under the services menu.  So by
    >> selecting the Finder menu, it would really trigger the service
    >> menu.  Is this possible?
    >
    > No. What is it you are trying to do exactly? This may help us, help
    > you.
    >
    >>
    >> I was just hoping to edit a nib file, point it to a different
    >> action, etc.
    >>
    >> I don't like the idea of doing this, I am just trying to satisfy
    >> their requirement.  They have heard my issues, but still have not
    >> budged on the requirement so far. :(
    >
    > Well I know I have had clients and employers like this also, it is
    > a tough situation, but this is not possible to do. So if you could
    > tell us exactly what you are trying to accomplish we may be able to
    > give you alternatives that maybe they could live with.
    >
    >
    >>
    >> Thanks,
    >> Ben
    >>
    >> On Sep 3, 2007, at 9:45 AM, development2 wrote:
    >>
    >>> What exactly are you trying to do? Could you do this with a
    >>> Finder Context menu? If you tell us what you are trying to do,
    >>> maybe we can help you find a way around this that you can present
    >>> to you client.
    >>>
    >>>
    >>> On Sep 3, 2007, at 2:41 AM, Ben Spink wrote:
    >>>
    >>>> This should be an easy question.
    >>>>
    >>>> I need to add a new item under the "Go" menu in the OS X
    >>>> Finder.  My client has stipulated this, otherwise I would not do
    >>>> so.  I have tried to talk them out of it, but so far no luck.
    >>>>
    >>>> I have edited the objects.xib file contained in /System/Library/
    >>>> CoreService/Finder.App/Contents/Resources/English.lproj/Menus.nib/.
    >>>>
    >>>> I added my new entries in there, picked an ID that did not
    >>>> appear to be used (716), assigned a key, but what do I do with
    >>>> the "command" entry?  If I leave it as is, it launches the
    >>>> command I copied instead of doing something I want.  I assume
    >>>> there is some listener that is catching all events generated by
    >>>> the menu.  Can I hook into that in some way?
    >>>>
    >>>> Is it possible to register a command to launch a specific
    >>>> application on the machine?  Or launch a specific path?
    >>>>
    >>>> I cannot seem to figure that part out.
    >>>>
    >>>> My experience in Cocoa is limited.
    >>>>
    >>>> Any suggestions on this?
    >>>>
    >>>> Is it possible?
    >>>>
    >>>> Thanks,
    >>>> Ben
    >>>>
    >>
    >>
  • On Sep 3, 2007, at 8:07 AM, Ben Spink wrote:

    > Under the Finder's Go, iDisk menu, they want a link to launch an
    > email with instructions for connecting to the idisk.  This would be
    > handled by Applescript, and I have no issue doing that provided I
    > can get the app to launch.
    >
    > The second one is they want the idisk "Connect to:" url copied to
    > the clipboard.  This too I was going to do with applescript,
    > provided I can get it to launch.
    >
    > That's it.  Launch two different applications, from two separate
    > menu items.

    That is still how you want to do something. :)

    What capability are you trying to provide the end user? What is the
    products intent?

    -Shawn
  • Well probably the best thing you can do then, is to create an
    NSStatusBar menu, in the upper right of the menu bar. This would give
    the user access to it at anytime, not just in the finder. You could
    easily do what you want from that then. But what they want you to do
    is just not feasible, and if you could do it, it would break with OS
    updates most likely.

    On Sep 3, 2007, at 9:07 AM, Ben Spink wrote:

    > Under the Finder's Go, iDisk menu, they want a link to launch an
    > email with instructions for connecting to the idisk.  This would be
    > handled by Applescript, and I have no issue doing that provided I
    > can get the app to launch.
    >
    > The second one is they want the idisk "Connect to:" url copied to
    > the clipboard.  This too I was going to do with applescript,
    > provided I can get it to launch.
    >
    > That's it.  Launch two different applications, from two separate
    > menu items.
    >
    > Thanks,
    > Ben
    >
    > On Sep 3, 2007, at 10:01 AM, development2 wrote:
    >
    >>
    >> On Sep 3, 2007, at 8:51 AM, Ben Spink wrote:
    >>
    >>> I have presented alternate method to then that i think would work
    >>> well.  However they are currently sticking to their requirement
    >>> that it must be an additional menu under the Finder's "Go" menu.
    >>>
    >>> I even thought about making a fake menu there, and having the
    >>> real menu be a service application under the services menu.  So
    >>> by selecting the Finder menu, it would really trigger the service
    >>> menu.  Is this possible?
    >>
    >> No. What is it you are trying to do exactly? This may help us,
    >> help you.
    >>
    >>>
    >>> I was just hoping to edit a nib file, point it to a different
    >>> action, etc.
    >>>
    >>> I don't like the idea of doing this, I am just trying to satisfy
    >>> their requirement.  They have heard my issues, but still have not
    >>> budged on the requirement so far. :(
    >>
    >> Well I know I have had clients and employers like this also, it is
    >> a tough situation, but this is not possible to do. So if you could
    >> tell us exactly what you are trying to accomplish we may be able
    >> to give you alternatives that maybe they could live with.
    >>
    >>
    >>>
    >>> Thanks,
    >>> Ben
    >>>
    >>> On Sep 3, 2007, at 9:45 AM, development2 wrote:
    >>>
    >>>> What exactly are you trying to do? Could you do this with a
    >>>> Finder Context menu? If you tell us what you are trying to do,
    >>>> maybe we can help you find a way around this that you can
    >>>> present to you client.
    >>>>
    >>>>
    >>>> On Sep 3, 2007, at 2:41 AM, Ben Spink wrote:
    >>>>
    >>>>> This should be an easy question.
    >>>>>
    >>>>> I need to add a new item under the "Go" menu in the OS X
    >>>>> Finder.  My client has stipulated this, otherwise I would not
    >>>>> do so.  I have tried to talk them out of it, but so far no luck.
    >>>>>
    >>>>> I have edited the objects.xib file contained in /System/Library/
    >>>>> CoreService/Finder.App/Contents/Resources/English.lproj/
    >>>>> Menus.nib/.
    >>>>>
    >>>>> I added my new entries in there, picked an ID that did not
    >>>>> appear to be used (716), assigned a key, but what do I do with
    >>>>> the "command" entry?  If I leave it as is, it launches the
    >>>>> command I copied instead of doing something I want.  I assume
    >>>>> there is some listener that is catching all events generated by
    >>>>> the menu.  Can I hook into that in some way?
    >>>>>
    >>>>> Is it possible to register a command to launch a specific
    >>>>> application on the machine?  Or launch a specific path?
    >>>>>
    >>>>> I cannot seem to figure that part out.
    >>>>>
    >>>>> My experience in Cocoa is limited.
    >>>>>
    >>>>> Any suggestions on this?
    >>>>>
    >>>>> Is it possible?
    >>>>>
    >>>>> Thanks,
    >>>>> Ben
    >>>>>
    >>>
    >>>

    >
  • it's one of few valuable things i learned in the academy where i
    studied:
    the first thing to do with a new client, is to translate their wishes
    into that what they really want. usually something completely
    different than their initial demands.

    if you manage to have them realise they actually don't want this non-
    solution (for a start, Shawn touched that subject, they will possibly
    have to invest again and again on each itteration of the OS..)

    but IF, i imagine you could create a solution in which you monitor if
    the user opens this 'Go' menu, and if they do you just display some
    custom contextual (interactive) help-palette next-to(ontopoff/etc..)
    the menu.
    probably the accessibility framework has some usefull features.

    a

    On Sep 3, 2007, at 19:05 , development2 wrote:

    > Well probably the best thing you can do then, is to create an
    > NSStatusBar menu, in the upper right of the menu bar. This would
    > give the user access to it at anytime, not just in the finder. You
    > could easily do what you want from that then. But what they want
    > you to do is just not feasible, and if you could do it, it would
    > break with OS updates most likely.
    >
    >
    > On Sep 3, 2007, at 9:07 AM, Ben Spink wrote:
    >
    >> Under the Finder's Go, iDisk menu, they want a link to launch an
    >> email with instructions for connecting to the idisk.  This would
    >> be handled by Applescript, and I have no issue doing that provided
    >> I can get the app to launch.
    >>
    >> The second one is they want the idisk "Connect to:" url copied to
    >> the clipboard.  This too I was going to do with applescript,
    >> provided I can get it to launch.
    >>
    >> That's it.  Launch two different applications, from two separate
    >> menu items.
    >>
    >> Thanks,
    >> Ben
    >>
  • On Sep 3, 2007, at 10:07 AM, Ben Spink wrote:

    > Under the Finder's Go, iDisk menu, they want a link to launch an
    > email with instructions for connecting to the idisk.  This would be
    > handled by Applescript, and I have no issue doing that provided I
    > can get the app to launch.
    >
    > The second one is they want the idisk "Connect to:" url copied to
    > the clipboard.  This too I was going to do with applescript,
    > provided I can get it to launch.
    >
    > That's it.  Launch two different applications, from two separate
    > menu items.

    In programing terms this is what we call a Really Bad Idea(tm).  On
    the whole it sounds like your client is unfamiliar with the Macintosh
    environment and the rules of "good citizenship" within that environment.

    Plugging into the Finder (or any other application's menu structure)
    without the express support of that application would make it seem as
    though the feature were created by the application's author.  Doing
    such a thing would be disingenuous and rude at best; it bordering on
    patently dishonest at worst.  Presenting your own application's
    features as the work of another company is sure to be a support
    nightmare for the other company (in this case, Apple).

    As other's have mentioned, the "requirement" cannot be met in a
    supported way.  Doing it at all would probably require more effort
    than the feature itself is worth.  Even if the feature could be done,
    however, it represents a violation of the Finder's user interface.

    I would recommend going back to this client and telling them that this
    requirement cannot, and more importantly should not, be done.

    Scott
  • Hi Ben,

    I hope you can't do this using Finder app. One alternative approach is:

    Use Script menu(Status bar item appear in the top right corner of
    the Desktop) to do your tasks via Apple scripts. Menu items gets
    created automatically after placing your scripts in the "/Library/
    Scripts/YourAppName/" folder.

    Regards,
    - Apparao.


    On 03-Sep-07, at 8:37 PM, Ben Spink wrote:

    > Under the Finder's Go, iDisk menu, they want a link to launch an
    > email with instructions for connecting to the idisk.  This would be
    > handled by Applescript, and I have no issue doing that provided I
    > can get the app to launch.
    >
    > The second one is they want the idisk "Connect to:" url copied to
    > the clipboard.  This too I was going to do with applescript,
    > provided I can get it to launch.
    >
    > That's it.  Launch two different applications, from two separate
    > menu items.
    >
    > Thanks,
    > Ben
    >
    > On Sep 3, 2007, at 10:01 AM, development2 wrote:
    >
    >>
    >> On Sep 3, 2007, at 8:51 AM, Ben Spink wrote:
    >>
    >>> I have presented alternate method to then that i think would work
    >>> well.  However they are currently sticking to their requirement
    >>> that it must be an additional menu under the Finder's "Go" menu.
    >>>
    >>> I even thought about making a fake menu there, and having the
    >>> real menu be a service application under the services menu.  So
    >>> by selecting the Finder menu, it would really trigger the service
    >>> menu.  Is this possible?
    >>
    >> No. What is it you are trying to do exactly? This may help us,
    >> help you.
    >>
    >>>
    >>> I was just hoping to edit a nib file, point it to a different
    >>> action, etc.
    >>>
    >>> I don't like the idea of doing this, I am just trying to satisfy
    >>> their requirement.  They have heard my issues, but still have not
    >>> budged on the requirement so far. :(
    >>
    >> Well I know I have had clients and employers like this also, it is
    >> a tough situation, but this is not possible to do. So if you could
    >> tell us exactly what you are trying to accomplish we may be able
    >> to give you alternatives that maybe they could live with.
    >>
    >>
    >>>
    >>> Thanks,
    >>> Ben
    >>>
    >>> On Sep 3, 2007, at 9:45 AM, development2 wrote:
    >>>
    >>>> What exactly are you trying to do? Could you do this with a
    >>>> Finder Context menu? If you tell us what you are trying to do,
    >>>> maybe we can help you find a way around this that you can
    >>>> present to you client.
    >>>>
    >>>>
    >>>> On Sep 3, 2007, at 2:41 AM, Ben Spink wrote:
    >>>>
    >>>>> This should be an easy question.
    >>>>>
    >>>>> I need to add a new item under the "Go" menu in the OS X
    >>>>> Finder.  My client has stipulated this, otherwise I would not
    >>>>> do so.  I have tried to talk them out of it, but so far no luck.
    >>>>>
    >>>>> I have edited the objects.xib file contained in /System/Library/
    >>>>> CoreService/Finder.App/Contents/Resources/English.lproj/
    >>>>> Menus.nib/.
    >>>>>
    >>>>> I added my new entries in there, picked an ID that did not
    >>>>> appear to be used (716), assigned a key, but what do I do with
    >>>>> the "command" entry?  If I leave it as is, it launches the
    >>>>> command I copied instead of doing something I want.  I assume
    >>>>> there is some listener that is catching all events generated by
    >>>>> the menu.  Can I hook into that in some way?
    >>>>>
    >>>>> Is it possible to register a command to launch a specific
    >>>>> application on the machine?  Or launch a specific path?
    >>>>>
    >>>>> I cannot seem to figure that part out.
    >>>>>
    >>>>> My experience in Cocoa is limited.
    >>>>>
    >>>>> Any suggestions on this?
    >>>>>
    >>>>> Is it possible?
    >>>>>
    >>>>> Thanks,
    >>>>> Ben
    >>>>>
    >>>
    >>>

    >
previous month september 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Go to today