jijifujiji
V2EX  ›  macOS

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

  •  
  •   jijifujiji · Dec 21, 2020 · 2960 views
    This topic created in 2132 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   ·   2511 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 04:52 · PVG 12:52 · LAX 21:52 · JFK 00:52
    ♥ Do have faith in what you're doing.