Created
April 8, 2018 05:54
-
-
Save shinyaoguri/4d74722cc6e2850cc09e177a13755dfe to your computer and use it in GitHub Desktop.
macでFinderに表示されるアプリを更新するスクリプト(たまに削除したはずのものが残ってたりする現象の回避)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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