Skip to content

Instantly share code, notes, and snippets.

@lincerely
Created December 13, 2022 11:35
Show Gist options
  • Select an option

  • Save lincerely/6f43cccd3e029bff0b36636bc82da114 to your computer and use it in GitHub Desktop.

Select an option

Save lincerely/6f43cccd3e029bff0b36636bc82da114 to your computer and use it in GitHub Desktop.
print all URL schemes in macos
#!/usr/bin/env bash
#lsURLscheme.sh - print all URL schemes in macos
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -dump |\
sed -n -e '/CFBundleName/p' -e '/CFBundleURLSchemes/,/);/p' |\
awk '
/CFBundleName/ {
sub(/;$/,"");
sub(" CFBundleName = ","");
app=$0;
next;
};
$0 !~ /(\);|CFBundleURLSchemes)/ {
sub(/,$/,"");
sub(/^ */,"");
print app "\t" $0;
};
' |\
sort | uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment