zoukankan      html  css  js  c++  java
  • Mac OS X下用 命令行打开网页(command line)

    open -a Safari http://stackoverflow.com



    I know there are several ways in MacOS to open Safari with a given URL from the command line like

    open -a Safari http://stackoverflow.com
    Or as an AppleScript

    tell application "Safari" to open location "http://stackoverflow.com/"

    in AppleScript, after opening Safari with URL

    tell application "Safari" to open location "http://stackoverflow.com/"
    

    you may obtain the process object by

    tell application "System Events" to set proc to application process "Safari"
    

    the proc object will have pid, bundle id and etc attached to it.

    Also please note that Safari 5+ runs in a multi-process architecture: a master process and several rendering process, the above code will get you the master process only; rendering processes are not easily accessible, nor does it make much sense to control any individual rendering process.

  • 相关阅读:
    四则运算
    自我介绍
    代练第七天
    代练第六天
    代练第五天
    代练第四天
    补充总结
    对软件工程课程的总结
    作业4:结对编程项目四则运算
    psp记录个人项目花费时间
  • 原文地址:https://www.cnblogs.com/willbin/p/2968775.html
Copyright © 2011-2022 走看看