AppleScript到Shell-Script

问题描述 投票:-1回答:1

当我复制多个数据段时

line 1
line 2
line 3

对于Mac上的剪贴板,我可以通过AppleScript通过以下方式访问其元素:>

on run {input, parameters}
set theClip to input as text
set value of variable "Empfänger" of front workflow to paragraph 1 of theClip
set value of variable "Betreff" of front workflow to paragraph 2 of theClip
set value of variable "Textkörper" of front workflow to paragraph 3 of theClip
end run

并将其写入Automator变量。我可以在Shell脚本中做同样的事情吗?当我运行

for f in "$@"
do
echo "$f"
done

似乎所有内容都存储在$ 1中。实际上,我不介意使用段落作为分隔符,而使用{NEXT}之类的可配置符号或类似符号。

谢谢你!

[当我将第1行,第2行,第3行等多段数据复制到Mac上的剪贴板时,我可以通过运行{input,parameters}通过AppleScript访问其元素,将theClip设置为以文本形式输入...]]

shell applescript paragraph
1个回答
0
投票
您的示例似乎很高兴将一行视为段落。所以,我会做同样的。因此,如果通过在下面选择它们并按

pressing

C
© www.soinside.com 2019 - 2024. All rights reserved.