jijifujiji
V2EX  ›  macOS

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

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

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

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