In creating some .mov files using Cocoa (Obj-C), I'd like to set them to be opened by default by a specific program, instead of the default. This should be a file level property, I do not wish to change the default program for all files with the same extension. This is to be done from Cocoa itself, as opposed to manually in "context menu">>"Get Info">>"Open With".
In Obj-C, how to programmatically set the default "open with" property of a file in Mac OS X
1k Views Asked by apalopohapa At
2
There are 2 best solutions below
2
JWWalker
On
As an intermediate between doing it by hand and doing it from Cocoa, there is an Automator action called "Set Application for Files".
I don't think there is a supported way to do it programmatically, but some people have figured out what Finder is doing: Adding a resource of type 'usro' that contains a full path to the application. See for example this discussion. Note: the Resource Manager is deprecated as of 10.8.
Related Questions in OBJECTIVE-C
- How do I customize NSOutlineView to have border color?
- UIWebView Screen Fitting Issue
- How to hide "Now playing url" in control center
- CloudKit: Preventing Duplicate Records
- Image and Text locations in UIButton
- setting OpenGL version in objective-C
- Setup code for xibs in iOS. -awakFromNb:
- realm db, get parent link of object
- CFBundleDocumentType is not working in myproject-Info.plist file
- UIPopoverPresentationController not rendering properly
- Using Storyboard Reference
- Pass Data between two view controllers using 'Delegation' : Objective-C
- Unexpected CALayer Vertical Flipping on 3D Rotation 'Bounce'
- Setting View orientation to portrait is ignored
- UITextField append / between dates while enforcing character limit
Related Questions in MACOS
- How do I customize NSOutlineView to have border color?
- Force sublime text to use PATH from the shell value
- Do executable files always open a terminal window on MacOS?
- setting OpenGL version in objective-C
- C std library don't appear to be linked in object file
- Cross compile simple standard C program on Linux for Mac
- How to generate request format for WCF web service method for Mac and iPhone
- Bundle Multiple Xamarin apps in one pkg installer
- How to Handle Command Line Prompt from a Cocoa App
- AVFoundation - Process each image separately
- CMYK NSImage get pixel data
- how i get the mac of ibeacon or BLE
- Set JAVA_HOME on Mac
- Finding active IPv6 interfaces under Mac OS (using Python)
- OSX: Why is my launchd agent running my script twice?
Related Questions in COCOA
- How do I customize NSOutlineView to have border color?
- How to generate request format for WCF web service method for Mac and iPhone
- How to Handle Command Line Prompt from a Cocoa App
- Change views inside NSSplitViewController
- CMYK NSImage get pixel data
- Reactive Cocoa Conditional Split ?
- Set background color of NSImageView with proportionally sized image
- Use NSWindow or NSViewController?
- Imports and includes in header files - when is it okay?
- How to prevent the app from automatically open a window when launched?
- Swift NSViewController responds to mouseDown event, but not keyDown event
- "stringByAddingPercentEncodingWithAllowedCharacters" replaces more characters than it should
- cocoa - what happen when close a window (by pressing the red X button)?
- Does it necessary to go back to main thread to update UI?
- WebView not responding to Keyboard input
Related Questions in OPEN-WITH
- Unable to open python files in python.exe of python 2.7
- How to "Open With" Photoshop CS5.1 in Sublime Text 2 using SideBarEnhancements (WinXP Machine)
- Correct the behaviour of OpenWith Dialog
- Show system "open with" dialog when clicking file from electron application
- The 'Open with' option is automatically changed with my app when my app is installed
- Is there any way to affect application sort in Disambiguation Dialog?
- Open a file with java application on macOS
- Change open file with... regedit
- How to make Eclipse as a Default Editor FOREVER in Mac OS-X?
- c# open file always show "Open With" dialog
- How to get Application name to be displayed in open-with list?
- Open an XML with a QTReport.exe
- Why does "tree = ElementTree.parse(f)" give the error "TypeError: parse() missing 1 required positional argument: 'source'" while arg is present
- Append data frame to an existing csv files with different number of columns
- How can we implement an Open with Postman button to open a postman collection link sent from a third party react application?
Related Questions in DEFAULT-PROGRAMS
- How to programmatically determine default applications in linux
- Change Default Program for .jar File
- How to enable quick edits from file manager in PhpStorm after install
- Cant change default program for opening custom files
- How come processStartInfo doesn't work
- get default Windows text editor .exe path using c++
- In Obj-C, how to programmatically set the default "open with" property of a file in Mac OS X
- Visual Studio files association in Windows
- How to set back the right default program for .vmoptions files?
- Windows Vista, Default Programs API, file format associations, and (un)installers - explosive mix!
- 'How do you want to open' 8.1 dialog and icons
- DISM /Import-DefaultAppAssociations runs successfully, but no file associations are changed
- wxLaunchDefaultApplication vs wxLaunchDefaultBrowser for opening a local directory in the default file manager
- Change default certificate manager for libreoffice
- Make our application show in access and defaults
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
There's an undocumented function call that sets this:
*If you use this in your application and submit it to the AppStore it will probably get rejected.