首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏Go实战

    在sublime中打开iterm 转

    $RUNNING )); then osascript<<END tell application "iTerm" tell current window end tell activate end tell END else if (( $OPEN_IN_TAB )); then osascript $RUNNING )); then osascript<<END tell application "iTerm" tell current terminal end tell end tell end tell END else if (( $OPEN_IN_TAB )); then osascript text "$CD_CMD" end tell end tell end tell EOF else osascript

    2.2K41发布于 2019-04-04
  • 来自专栏江歌闲谈

    macOS 下 iTerm 如何安装 rzsz

    # licensed under cc-wiki with attribution required # Remainder of script public domain osascript -e to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm if [[ $NAME = "iTerm" ]]; then FILE=`osascript shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"` else FILE=`osascript # licensed under cc-wiki with attribution required # Remainder of script public domain osascript -e to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm if [[ $NAME = "iTerm" ]]; then FILE=`osascript

    88500发布于 2021-06-14
  • 来自专栏devops_k8s

    iTerm2使用rz,sz及一些提高效率骚操作命令

    # licensed under cc-wiki with attribution required # Remainder of script public domain osascript - to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm if [[ $NAME = "iTerm" ]]; then FILE=`osascript shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"` else FILE=`osascript # licensed under cc-wiki with attribution required # Remainder of script public domain osascript - to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm if [[ $NAME = "iTerm" ]]; then FILE=`osascript

    1.3K50发布于 2021-07-12
  • 来自专栏全栈程序员必看

    macOS 安装lrzsz

    /bin/bash osascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME =iTerm if [[ $NAME = "iTerm" ]]; then FILE=`osascript -e 'tell application "iTerm" to activate' -e ' shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"` else FILE=`osascript /bin/bash osascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME =iTerm if [[ $NAME = "iTerm" ]]; then FILE=`osascript -e 'tell application "iTerm" to activate' -e '

    1.9K10编辑于 2022-09-09
  • 来自专栏FreeBuf

    Swift-Attack:专为蓝队设计的macOS后渗透方法测试套件

    单元测试项目 使用osascript脚本调用终端; 通过API调用终端; 使用osascript脚本导出剪贴板内容; 使用API导出剪贴板内容; 使用screencapture获取屏幕截图; 使用API 调用获取屏幕截图; Shell命令支持; 导出zsh历史记录; 安全工具枚举; 使用osascript脚本获取系统信息; 通过API调用获取系统信息; 导出磁盘中的ssh、aws、gcp和azure密钥

    1.3K60发布于 2021-07-27
  • 来自专栏月色的自留地

    jxa快速入门,Javascript已加入AppleScript全家桶

    首先介绍适合初学者练习用的命令行交互式运行环境,也叫REPL (read-eval-print-loop): osascript -il JavaScript 在交互环境中,首先获取当前运行的app,然后运行附加脚本执行 /usr/bin/env osascript -l JavaScript var app = Application.currentApplication() app.includeStandardAdditions 开头表示是脚本标志,后面的是脚本解释器的路径,在这里是/usr/bin/env osascript -l JavaScript,/usr/bin/env的意思是在环境参量中寻找后面的osascript命令来执行 /usr/bin/env osascript -l JavaScript //引用c的函数库 ObjC.import('stdlib') //这样引用的函数,都在$.这个域下面 function run

    3.5K40发布于 2018-06-20
  • 来自专栏LinkinStar's Blog

    MacOS 下 zsh 执行长时间命令完成后自动提醒

    检查上一个命令是否包含要匹配的字符串 for string in $string_to_match; do if [[ $previous_command == *"$string"* ]]; then osascript echo linkinstar 其实原理非常简单,就是通过 add-zsh-hook 的钩子,在执行命令之之前(当前命令执行结束)判断,上一个命令是否在我的匹配列表中,如果这个命令需要提示则使用 osascript 其他尝试与问题 我尝试过通过判断上一个命令的执行时间比如超过 10 秒的命令就才进行提示,但实际使用效果并不好,有时候 9 秒的命令就很尴尬,所以还是认为指定具体命令效果更好 osascript 还支持

    1K20编辑于 2023-05-02
  • 来自专栏周拱壹卒

    MacOS 实现自动切换鼠标滚动方向

    then click it end tell end if end tell end tell quit application "System Preferences" 执行脚本: $ osascript then click it end tell end if end tell end tell quit application "System Preferences" 执行脚本: $ osascript -eq 0 ]; then # 检测到了鼠标设备 osascript scroll-direction-mouse.applescript else # 没检测到鼠标设备 osascript scroll-direction-trackpad.applescript fi 注:脚本中的 mouse_keyword 可以根据实际情况调整,以精确检测鼠标设备。

    2.4K20编辑于 2024-05-11
  • 来自专栏极客起源

    告诉你个秘密,Python也能控制回收站

    因此,在macOS下恢复废纸篓中的文件,只能通过osascript命令了。osascript 是 macOS 上执行 AppleScript 的命令行工具。 使用 osascript 命令可以在终端中运行 AppleScript 脚本,也可以在脚本中使用 AppleScript 来发送系统通知。 以下是一个发送系统通知的例子: osascript -e 'display notification "Hello World!" down delay 2 -- 延迟2秒 end tell end tell end recoverMyFile 将这段代码保存在apple.script文件中,然后执行osascript 在执行apple.script文件时,有可能出现下面的错误: execution error: “System Events”遇到一个错误:“osascript”不允许发送按键。

    1.5K00编辑于 2024-05-27
  • 来自专栏IMWeb前端团队

    使用 JavaScript 自动化你的 Mac

    OSX自带一个自动化脚本解释器叫osascript,AppleScript和JavaScript编写的脚本都需要又他来解释执行,就像node解释执行js文件一样。 所以可以按照上面的列子编写js脚本然后在命令行里执行命令: osascript-l JavaScript/path/to/file.js 或者可以在js文件的顶部加上一行: #! /usr/bin/env osascript-l JavaScript 然后在chmod +x /path/to/file.js 就可以直接执行这个js文件执行自动化操作了 更多资源 苹果官方文档 高级开发文档

    2.7K30发布于 2019-12-04
  • 来自专栏IMWeb前端团队

    使用 JavaScript 自动化你的 Mac

    OSX自带一个自动化脚本解释器叫osascript,AppleScript和JavaScript编写的脚本都需要又他来解释执行,就像node解释执行js文件一样。 所以可以按照上面的列子编写js脚本然后在命令行里执行命令: osascript-l JavaScript/path/to/file.js 或者可以在js文件的顶部加上一行: #! /usr/bin/env osascript-l JavaScript 然后在chmod +x /path/to/file.js 就可以直接执行这个js文件执行自动化操作了 更多资源 苹果官方文档 高级开发文档

    3.6K101发布于 2017-12-29
  • 来自专栏TalkPython

    使用Python,怎么mac 上打开一个应用程序?

    具体程序如下: import os os.system("""osascript -e 'tell app "Safari" to open'""") 希望,今天的分享对你有启发。

    3K20发布于 2020-12-29
  • 来自专栏技术小黑屋

    Mac终端新标签打开当前目录

    /bin/bash osascript -e 'tell application "Terminal"' \ -e 'tell application "System Events" to tell process

    3K10发布于 2018-09-04
  • 来自专栏安恒网络空间安全讲武堂

    MacOS CryptoMining恶意软件的崛起

    程序参数显示,编码器对AppleScript和osascript并不是很熟悉,并且会错乱地通过AppleScript中的do shell script命令,用osascript调用它自己。

    1.1K30发布于 2019-09-29
  • 来自专栏前端导学

    mac电脑清理docker垃圾文件脚本

    save -o ${tar}.tar ${image} echo "==> Done." done echo "=> Cleaning up" echo -n "==> Quiting Docker" osascript

    1.5K20发布于 2019-05-28
  • 来自专栏golang分享

    我是如何开发一款属于自己的chrome网站黑名单插件

    但是后续发现这样并不太好使,所以改为从shell脚本里执行快捷键的命令 即添加 这两行即可 osascript -e 'tell application "System Events" to keystroke "l" using {command down}' osascript -e 'tell application "System Events" to keystroke "c" using {command

    4.8K21编辑于 2024-07-11
  • 来自专栏golang分享

    我攻克的技术难题: 我是如何解决开发中Chrome插件问题

    但是后续发现这样并不太好使,所以改为从shell脚本里执行快捷键的命令 即添加 这两行即可 osascript -e 'tell application "System Events" to keystroke "l" using {command down}' osascript -e 'tell application "System Events" to keystroke "c" using {command

    5.1K51编辑于 2024-02-05
  • 来自专栏fastmock

    nodemon+cross-env+config实现支持热更新的能根据不同环境加载不同配置的nodejs环境

    ], "verbose": true, "execMap": { "js": "node --harmony" }, "events": { "restart": "osascript

    1.2K20编辑于 2022-07-13
  • 来自专栏向治洪

    关于jd-gui启动报This program requires Java 1.8+的错误

    ... fi # (#75) check for undefined icons or icon names without .icns extension and prepare # an osascript 4] ${MSG_JVMVERSION_REQ_INVALID_EXPANDED}" # display error message with AppleScript osascript 5] ${MSG_JVMVERSION_REQ_INVALID_EXPANDED}" # display error message with AppleScript osascript EXIT 3] ${MSG_NO_SUITABLE_JAVA_EXPANDED}" # display error message with AppleScript osascript stub_logger "[EXIT 2] ${MSG_MISSING_MAINCLASS}" # display error message with AppleScript osascript

    1.9K20编辑于 2022-05-25
  • 来自专栏颖奇L'Amore

    TextMate:轻量级代码编辑器

    " == iTerm ] || [ $(iTerm_running) == 0 ]; then osascript hljs-string"> end tell END else osascript

    3.2K30编辑于 2022-10-31
领券