9 Commits
Author SHA1 Message Date
Gregorio Litenstein 4672a7f028 Fix reference to SwiftCLI package. 2024-03-07 15:02:11 -03:00
Gregorio Litenstein 19bd0836d6 Resuming development 2023-08-17 17:42:54 -04:00
Werner Robitza c35002a671 fix formatting 2023-04-19 00:22:42 -04:00
Gregorio LitensteinandJohn Bachir 6fb3fadc6e Update README.md
Co-authored-by: John Bachir <jjb@users.noreply.github.com>
2022-08-06 19:34:38 -04:00
Joris Berthelot 8cb414a906 Add steps to have the Do Nothing app working.
Close https://github.com/Lord-Kamina/SwiftDefaultApps/issues/12
2022-08-06 19:34:38 -04:00
Andrew Udvare a2f3dbac3c Fix Swift error 2022-08-06 19:33:25 -04:00
Muescha 8fa723ef79 add info about brew install 2022-08-06 19:32:48 -04:00
Gregorio Litenstein 665c721bfd Merge pull request #41 from glaucocustodio/patch-1
Update README.md
2020-10-16 09:47:47 -03:00
Glauco Custódio bd59579501 Update README.md
I was missing this info, it might be useful for other people too.
2020-10-16 11:38:29 +01:00
4 changed files with 49 additions and 11 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
[submodule "Packages/SwiftCLI-2.0.3"]
path = Packages/SwiftCLI-2.0.3
url = https://Lord-Kamina@github.com/Lord-Kamina/SwiftCLI
url = https://github.com/Lord-Kamina/SwiftCLI
+46 -8
View File
@@ -1,3 +1,6 @@
ANNOUNCEMENT: I have recently noticed Apple has introduced replacements for the deprecated APIs used in this prefpane. As a result, slow as it may be, I plan to resume development. I will be taking PRs as well, if somebody wishes to contribute.
========
SwiftDefaultApps
========
@@ -7,9 +10,37 @@ Additionally, I guess it was a good way to teach myself Swift.
Feel free to contribute, comment or report issues at https://github.com/Lord-Kamina/SwiftDefaultApps.
## Installing & Uninstalling
To install, double click on the .prefpane, and you will be prompted to install it.
To uninstall, simply Ctrl+Click on the Prefpane icon and remove it, or move the .prefpane file to the Trash.
* Download latest release from https://github.com/Lord-Kamina/SwiftDefaultApps/releases
* To install, double click on the `.prefpane`, and you will be prompted to install it.
* To uninstall, simply Ctrl+Click on the Prefpane icon and remove it, or move the `.prefpane` file to the Trash.
## Installting with brew
Run:
```bash
brew install swiftdefaultappsprefpane
```
then use Spotlight to open the `SwiftDefaultApps.prefpane`. It will open the System Preferences and you find the app on the bottom of the icons.
## How to use the "Do Nothing" app
The **Do Nothing** dummy app needs to be launched before you can use it in the pref pane. For this, open a terminal and run the following commands:
```bash
appDir="/Library/PreferencePanes/SwiftDefaultApps.prefPane/Contents/Resources/ThisAppDoesNothing.app"
if ! [[ -d "$appDir" ]]; then appDir="$HOME/$appDir"; fi
# Remove quanrantine flag
xattr -d com.apple.quarantine "$appDir"
# Open the app
open "$appDir"
```
After these 2 steps, the **Do Nothing** app should work when you pick it up.
## Usage Notes
@@ -22,6 +53,12 @@ The user-interface should be pretty self-explanatory; but, there are some things
- The second is **"Other..."**, which obviously will allow you to select an application not in the list; with a caveat. In recent versions of macOS, the LaunchServices have become quite a bit smarter under the hood than they used to be. In practice, what this means is that although you can choose *any* application to handle anything, only valid associations will be preserved, as the LaunchServices is permanently looking for invalid or stale associations and removing them.
- One final note: In the URI Schemes tab, you have the option of adding a custom URI Scheme (Removing them on demand is neither possible nor necessary, due to the same thing explained above). This options is provided for completeness' sake; you should virtually never need to use it, since Launch Services should be able to properly detect any valid URL Handlers. As a further cautionary note: If you add a custom URI Scheme when it is not needed, you may not be able to remove it except by uninstalling and reinstalling SwiftDefaultApps. Why? Because new schemes are by default associated to *"Do Nothing", which means Launch Services will always find a valid handler as long as SwiftDefaultApps is installed.
### How to Find Out File UTI
Run in your terminal the following command (replace my_song.mp3 by your file):
`mdls -name kMDItemContentType -name kMDItemContentTypeTree -name kMDItemKind my_song.mp3`
## Acknowledgments & Attributions
- Using jakeheis' SwiftCLI 2.0 as a base for the CLI version located inside the bundle. (https://github.com/jakeheis/SwiftCLI)
@@ -34,13 +71,16 @@ The user-interface should be pretty self-explanatory; but, there are some things
- Gears designed by Freepik (http://www.freepik.com/free-vector/gray-background-of-gear_956712.htm)
## Current Version
- Version: 2.0.1
- Date: 2019-07-26
- Version: 2.0.1
- Date: 2019-07-26
## Known Issues
-
See https://github.com/Lord-Kamina/SwiftDefaultApps/issues
## TO DO
- Localizations
# Release Notes
@@ -91,5 +131,3 @@ The user-interface should be pretty self-explanatory; but, there are some things
+ Initial release!
+ ### Changed
+ ### Fixed
+1 -1
View File
@@ -359,7 +359,7 @@ class LSWrappers {
- Parameter outBundleID: This parameter is populated with a bundle identifier if a valid application bundle corresponding to the input parameter was found.
- Returns: A status-code. `0` on success, or a value corresponding to various possible errors.
*/
static func getBundleID (_ inParam: String, outBundleID: inout String? = nil) -> OSStatus {
static func getBundleID (_ inParam: String, outBundleID: inout String?) -> OSStatus {
var errCode = OSStatus()
let filemanager = FileManager.default
if (inParam == "None") { // None is a valid value for our dummy application.