V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
oIMOo
V2EX  ›  macOS

macOS Shortcuts 如何调用 Run AppleScript with "input"?

  •  
  •   oIMOo · 2022-11-28 20:43:54 +08:00 · 636 次点击
    这是一个创建于 507 天前的主题,其中的信息可能已经有所发展或是发生改变。

    在 macOS Ventura 13.0.1^1 中,创建捷径可插入“Run AppleScript with 'input'” 动作。

    请问在此动作中,如何调用该值?

    比如:

    • 动作 1:set variable my_input to "worldcup"
    • 动作 2:Run AppleScript with my_input
      1. ……
      2. set xxx to my_input

    在动作 2 中,会将( 2.)中的 my_input 识别为一个值,并报错 my_input 没有被定义 (The variable my_input is not defined)。

    我尝试将 ( 2.) 中的 my_input 换为 input 或者 parameter ,同样提示没有被定义。


    1 不确定其他系统版本是否支持

    第 1 条附言  ·  2022-11-28 22:27:34 +08:00
    https://www.icloud.com/shortcuts/06c482f2a7194643b9c539cd77a1100b

    这个捷径中,Run ApleScript with 后面已经使用魔法变量选择为 Clipboard 。

    如果删除上一条动作“Copy Text from Image to clipboard”, 并将 Run ApleScript with 后面的 input 使用魔法变量改为 Text from Image ,那么 script 中如何调用这个 input ( Text from Image )?
    2 条回复    2022-11-28 22:05:57 +08:00
    Kanye
        1
    Kanye  
       2022-11-28 21:16:23 +08:00
    在跑 applescript 的 block 选择魔法变量
    oIMOo
        2
    oIMOo  
    OP
       2022-11-28 22:05:57 +08:00
    @Kanye 在动作 2 的 input 位置,可以选择魔法变量
    但是在动作 2 中(也就是 AppleScript 的编写中),无法再选择魔法变量
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1197 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 23:13 · PVG 07:13 · LAX 16:13 · JFK 19:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.