如何获取和传递触发捕获的文本中的脚本函数调用ITERM2中的脚本函数调用?
我试图添加一个触发器以某种模式捕获文本,并将其传递给
我的脚本:
#!/usr/bin/env python3
import iterm2
async def main(connection):
@iterm2.RPC
async def myfunc(captured_text):
print(captured_text)
await myfunc.async_register(connection)
iterm2.run_forever(main)
我尝试使用myfunc(capture_text:trigger.captrud_strings)
在配置文件中设置触发参数。触发设置,它不起作用,并且报告了错误对未定义变量“ trigger.captrud_strings”
的引用。
I was trying to add a trigger to capture text in some pattern and pass it to a Python script
My script is:
#!/usr/bin/env python3
import iterm2
async def main(connection):
@iterm2.RPC
async def myfunc(captured_text):
print(captured_text)
await myfunc.async_register(connection)
iterm2.run_forever(main)
I tried to set the trigger Parameters with myfunc(captured_text: trigger.captured_strings)
in the profile trigger settings, it didn't work and the error Reference to undefined variable "trigger.captured_strings"
was reported.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论