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

通过 Automator 实现自动切换默认浏览器

  •  
  •   gongziheng1995 · Apr 23, 2015 · 2753 views
  •   You need to sign in to view this topic
    This topic created in 4025 days ago, the information mentioned may be changed or developed.

    想通过 Automator 实现自动切换默认浏览器,实现「用电池时使用 Safari ,接上电源时使用 Chrome 」,不知道如何下手,具体怎么实现?

    如果通过 Automator 有困难的话,可以通过 Alfred workflow 每次手工快速切换吗?

    5 replies    2015-04-23 17:32:53 +08:00
    tishifu
        1
    tishifu  
       Apr 23, 2015
    原则上应该可以,但是没有试过,不过这么切来切去也挺麻烦的!
    doskoi
        2
    doskoi  
       Apr 23, 2015   ❤️ 2
    无非就是搜索2条命令,

    pmset可以查看电池相关信息,

    ➜ ~ pmset -g ac
    没接电源就是 No adapter attached.

    接上电源就是 Wattage = 45W 等信息。

    然后 搜搜怎么命令行设置默认浏览器

    open -a "Google Chrome" --args --make-default-browser

    搭积木似得,剩下的还用教吗?
    goofansu
        3
    goofansu  
       Apr 23, 2015 via iPhone
    comtrolplane
    goofansu
        4
    goofansu  
       Apr 23, 2015 via iPhone
    controlplane
    pH
        5
    pH  
       Apr 23, 2015
    @goofansu Control panel?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1330 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 17:04 · PVG 01:04 · LAX 10:04 · JFK 13:04
    ♥ Do have faith in what you're doing.