jijifujiji
V2EX  ›  macOS

请教如何用 AppleScript 获取选中的文本

  •  
  •   jijifujiji · Dec 21, 2020 · 2859 views
    This topic created in 2089 days ago, the information mentioned may be changed or developed.

    刚刚接触 AppleScript,我想写个脚本需要获取选中的文本。 请教如何获取

    2 replies    2020-12-26 21:36:12 +08:00
    fatestigma
        1
    fatestigma  
       Dec 22, 2020
    对于有 document container 的应用可以用
    tell application "<app name>" to get selection of document <doc index>
    jijifujiji
        2
    jijifujiji  
    OP
       Dec 26, 2020
    @fatestigma 好的谢谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5713 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 03:20 · PVG 11:20 · LAX 20:20 · JFK 23:20
    ♥ Do have faith in what you're doing.