Skip to content

Instantly share code, notes, and snippets.

@shinyaoguri
Created April 8, 2018 05:54
Show Gist options
  • Save shinyaoguri/4d74722cc6e2850cc09e177a13755dfe to your computer and use it in GitHub Desktop.
Save shinyaoguri/4d74722cc6e2850cc09e177a13755dfe to your computer and use it in GitHub Desktop.
macでFinderに表示されるアプリを更新するスクリプト(たまに削除したはずのものが残ってたりする現象の回避)
#!/usr/bin/env python3
import subprocess
def main():
print("Finderで表示される起動するアプリ一覧を更新するよ!")
cmd = "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user"
subprocess.check_call(cmd.split(" "))
print("Refresh Finder App list.")
cmd2 = "killall Finder"
subprocess.check_call(cmd2.split(" "))
print("Finderを再起動したよ")
if __name__ == "__main__": main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment