How do I add my own option to Finder's right click menu? - objective-c

I have an app that basically takes a file path(s) and copies the data name and extension from it to be used in my app. I was wondering how to add on to the Finder right click menu (like Dropbox does) and do run some Objective-C code when clicked. (I need to get the path(s) of the selected file). Is there any way to do this? All the answers I've seen are very vague and unhelpful. I do not want to use mach_inject because my app might go onto the appstore, and I can probably get FinderSync API to work.

Take a look at the FinderSync API in Yosemite; I'm fairly sure you don't need to sync anything, but you can use the API to install a toolbar and sidebar item as well.

Related

How do i create my own right click menu on the desktop?

i have searched up and down the internet but cannot figure this out. So ive finally come here for the aid of some utter genius people.
I dont like the windows right click function as it has too many options. Some of the options like properties cannot be removed. So, i thought i could disable right click to remove the menu and create my own.
The problem i have is i cannot figure out for VS2010 how to right click on the desktop outside of the form/project and make a box pop up like the same behaviour as the built in one. I am ultimately wanting to be able to expand and add things but im falling at the first hurdle.
Can someone please tell me how to right click on the desktop and create a context menu popup where i can add my own items. i want it to behave the same as windows but i want it my own essentially. This way in the future i will be able to enable or disable my own functions i.e open/winrar/7zip / remove edit on the fly.
thanks
Ka0s
Remove/Disable the default menu of desktop is not a good idea at all
But you can add your own items as well using 3rd party apps
I made an app modifies the default menu ,it can append more items an sub items
I wrote it long time ago I do not remember if i still have the source code or not
App link

How to set custom icon for file-type in mac osx

I have a launcher application for some file-types in mac osx. I want to know is it possible to register custom Icon for file-types associated with my launcher application? and does anybody know exact behavior of OS, when does it show Icon and when does it show some empty icon?
Question 1:
It's easy. In finder, right click on the filename with the extension you're interested in.
Find the "Open with:" section,
Click on the blue part and navigate to your launcher app and select it.
Then click on "Change All..."
Write down, or remember what it used to be before changing it, in case you want to go back to the old behavior. It affects all files with that extension.
Question 2:
Check this link for information on filling in the images in your assets folder: App Icons
If you include an icon in your app, and do the above steps, the icon will show. If you don't include one, it won't.

Add more one button on Attach menu of Whatsapp

I've an idea to develop a modification to WhatsApp, for example now when I click attachment symbol it shows only 6 I want to add one more option to it. If it's possible let me know. I want to add more one button on Attach menu.
It is not clear what exactly you are asking.
You have an option to launch other applications from your app.
If you want to change the way a certain app looks, or behaves you have to write something similar to it for people to use, but you cannot change the original app (no one will let you)
Here you go! it's possible, as #Jef said in comments.
using documentation interaction controller.
https://www.whatsapp.com/faq/iphone/23559013
you need to work on how to hook into attachment menu.
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDocumentInteractionController_class/
There is an assumption in your question that these other apps are put there by the whatsApp developers, or by a third party who was somehow able to modify their code. I suspect that what is happening is that they (whatsApp) simply export a document/file of a certain type (UTI) If your application supports that same UTI it should appear here. So there is six buttons for you, on your phone, but another user might see a different number, it depends entirely what they have installed on their device.
CONCEPTUAL.. if you double click on a file on your computer then the file browser (OS) opens that file with some application or other. Perhaps it is a .doc file and the OS pushes that file to word or pages. Or it may be a .psd file and it gets pushed to photoshop. How does this happen? The OS has a registry (database) of applications for each file type, applications sign up on this when they install/update. If you right click on a file you see an 'open in..' option that lists all your applications which can handle that file type, this is the menu that you are wanting to get onto (for whatsApp's file type) imho.
So you need to
1 ascertain what file type (UTI) WhatsApp is exporting
2 declare support for that file type in your application (this is the bit which will be platform specific solution) (iOS docs https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/Articles/RegisteringtheFileTypesYourAppSupports.html#//apple_ref/doc/uid/TP40010411-SW1 )
**edit/addition
3. add the code to actually handle the file when your app receives it. On iOs this is in the appDelegate in
-(void) application: openURL: sourceApplication:annotation:
If the Whatsapp people have published an API then thats where you want to look. Good luck

Mac OS X: Global Shortcut to get selected text/image in Application

I'm trying to build an app that get's selected text from other applications if a certain shortcut/hotkey is pressed. First I tried the Carbon Hotkey API, but then I couldn't get selected text from other applications. Second I've tried building a service that gets the selected text from other applications and is called with a global shortcut, but I wasn't able to use a custom shortcut. Somehow only CMD+SHIFT is allowed as a modifier in the plist and these kind of shortcut is already used in many applications so it's often not working. CTRL and a key would be a cool shortcut, because not many applications use this kind of shortcut, but I can't specify such a modifier.
Any Ideas how to solve this problem?
To answer your second question, you can manually edit the Services plist file. Find details here:
Set Custom KeyEquivalent in Services Menu

Launch application using openwith on mouse click

Can any one tell me about how to lanch a self-made application using the "openwith" feature of a mouse click event?
Your question is not very clear, but I understand it as "How do I tell the Finder that my application knows handle certain file types?". Once the Finder knows the link, it will suggest your application in the Open With submenu that appears when you ctrl/right-click on a file.
Have a look at the Apple documentation. Basically, you have to declare all the supported file types in Info.plist (or what you called it). The system is based on Universal Type Identifiers.