Add your own NSMenuItem to Finder menu - macos

I'm pretty sure this is possible since Dropbox has done it. Here's a screenshot:
http://content.screencast.com/users/calebjj/folders/Jing/media/eec88ca2-f9a9-4aa3-bd79-a78900087968/00000064.png
I'm looking to add an nsmenuitem to the finder menu when a user right clicks on a file in the finder window. Is this possible? If so how can this be done? And for that matter, so has TextWrangler (shown at the bottom)

What you are looking at is a service. Look up "Services Menu" in the Apple help and you'll find out how your application can offer these services.

Related

Obtain the NSToolbar look of Finder's preferences window

I am building a preferences window for my app and would like to achieve the same "look" as the NSToolbar that Finder uses. When selected, the toolbar buttons in Finder look "pushed in". On the right-hand side of the image is my preferences window - you'll notice that even though General is selected it does not look "pushed in". How do I achieve the look of Finder (and most other built-in apps)?
Thank you,
CS
When you build the toolbar in Xcode you add toolbar items to it. Each toolbar item can be customized in the right pane of Xcode. Choose "Selectable" as behaviour and it works as you expect.

How to completly restore a Edit menu in Cocoa or find missing Actions like Redo

I deleted the Edit menu from my cocoa app but now I need to restore it with all the voices. I tryed to copy it from another app but it lose all the Actions... so I found myself with all the voices of the menu but they do nothing... so I started to connect all the voices in First Responder and it was working but then I noticed that some voices like "Redo" and others are not in First Responder and I don't know where to find them..
Is there a way to completly restore the Edit menu in my app? or if it is no possible anyone knows where I can find the missing Actions like Redo?
Thanks for any help - Peace - Massy
Look in the Interface Builder Object Library (Where there are buttons and other controls to drag onto your interface.)
There you will find Edit Menu Item. (Search for it if you can't see it.) You can drag it into your menu.

Detect click on OS X menu bar?

I'm curious if there's a trick to detecting a click on the Menu Bar as a whole. I know I can detect a click on an NSStatusItem or NSMenu, but I am looking for events pertaining to the empty space of the Menu Bar.
Looking through the documentation, it does not seem possible. However, I wanted to know if anyone had a workaround for this functionality?
You can install a local event monitor using NSEvent addLocalMonitorForEventsMatchingMask:handler:
See the documentation located here.

How to display my app's icon (programmatically) on the top right corner of the Mac OS X menu bar

I know Skype does it - they have a special icon register to there. And then when user click on the icon, a drop down menu will appear...
See the docs for status bar and NSStatusItem. You can also find tutorials and sample code by googling for NSStatusItem.
NSStatusItem is responsible for this.

How do you show the Finder context menu from a Cocoa application?

I have a file listing in my application and I would like to allow people to right-click on an item and show the same contextual menu as Finder does. Is this possible?
The same functionallity but for Windows Explorer is discussed in How do you show the Windows Explorer context menu from a C# application?.
You can't extract the Finder's contextual menu in any stable way, no. Neither can you tell the Finder “show your contextual menu here, as if the user had right-clicked on this item”.
You'll have to make your own.
If I understand the question correctly...
Showing a custom icon and action in your Finder Context Menu is now possible in OS X 10.10 Yosemite via a Finder Sync Extension:
https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/Finder.html

Resources