V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
callmesmc
V2EX  ›  Apple

macOS 下如何批量更改默认应用?

  •  
  •   callmesmc · Sep 9, 2022 · 3221 views
    This topic created in 1335 days ago, the information mentioned may be changed or developed.

    比如:

    • 所有文本格式全部用 vs code 打开;所有媒体格式全部用 iina 打开
    • 一个应用关联的全部格式全部设成默认
    9 replies    2022-11-14 12:32:40 +08:00
    WillBC
        1
    WillBC  
       Sep 9, 2022   ❤️ 1
    y1y1
        2
    y1y1  
       Sep 9, 2022   ❤️ 1
    appcleaner & uninstaller 有个 default apps 功能挺方便
    shineonme
        3
    shineonme  
       Sep 9, 2022 via iPhone   ❤️ 1
    修改单个后缀名默认打开应用,随便开一个该后缀名的文件的简介,最下面有默认打开应用,选择后按全部更改。
    直接修改某一类型的文件,倒不太清楚。
    callmesmc
        4
    callmesmc  
    OP
       Sep 9, 2022
    @y1y1 我之前也用这个应用,但它好像只能一个一个改,而且不支持 ventura
    dingwen07
        5
    dingwen07  
       Sep 9, 2022 via iPhone   ❤️ 1
    你只要装了 Xcode ,系统就会时不时把很多类型的默认打开方式改成它……
    callmesmc
        6
    callmesmc  
    OP
       Sep 9, 2022   ❤️ 1
    @WillBC 谢谢,好东西啊
    WillBC
        7
    WillBC  
       Sep 9, 2022   ❤️ 2
    @callmesmc #6

    补充一下如果要找 App 默认打开的文件后缀可以在比如说 /Applications/Emacs.app/Contents/Info.plist 里搜 CFBundleTypeExtensions



    找后缀的 UTI (Uniform Type Identifier) 可以用 mdls -name kMDItemContentTypeTree /path/to/file



    找 App 的 Bundle ID 可以用 mdls -name kMDItemCFBundleIdentifier -r /Applications/Emacs.app/

    这样就可以结合 duti 使用

    duti -s org.gnu.Emacs public.plain-text all
    duti -s org.gnu.Emacs public.unix-executable all
    duti -s org.gnu.Emacs public.data all
    duti -s org.gnu.Emacs md all
    duti -s org.gnu.Emacs json all
    duti -s org.gnu.Emacs yaml all

    这方面只目前了解了这么多,不过应该可以根据以上关键词搜索更多相关信息了
    Sixi
        8
    Sixi  
       Nov 14, 2022
    macOS 13.0 发现即使将,public.data 和
    Sixi
        9
    Sixi  
       Nov 14, 2022
    @Sixi 没输入完按错直接回复了。macOS 13.0 发现即使通过 duti 将 public.data 和 public.item 设置为 VS Code 打开,依然没有效果。不知道为什么。另外可以直接使用这个工具 https://rubicode.com/Software/RCDefaultApp/ 设置,非常简便。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3697 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 00:04 · PVG 08:04 · LAX 17:04 · JFK 20:04
    ♥ Do have faith in what you're doing.