Automator 添加不需要的换行符
Automator adding unwanted line breaks
我正在使用 Automator 创建一个 HTML 页面并且一切正常,但我 运行 遇到了一个小问题。在开始时要求用户提供信息,然后将其设置为变量。该页面是通过使用 Get Specified Text 抓取一些代码并将其复制到剪贴板、获取其中一个变量然后将它们都放入文本文档来创建的。然后重复此过程几次,最终创建一个 HTML 文件。我 运行 遇到了问题,因为 Automator 在指定文本的每一位和每个变量之间创建换行符(可能是回车符 returns?)。所以,我想要的是这样的:
<code grabbed using "Get Specified Text" followed by a Variable. And now some more text and another Variable.>
最终看起来像这样:
<code grabbed using "Get Specified Text" followed by a
Variable
. And now some more text and another
Variable
.>
这将我的页面分成几个部分。有没有办法防止这些换行符?
从一个动作传递到另一个动作的项目在 列表 中,因此设置 TextEdit 内容似乎用换行符分隔各个项目,换行符是正常的段落分隔符.
许多文本操作采用 TextEdit and/or 富文本并且不使用变量(或与其他纯文本操作相处),因此 运行 AppleScript 操作可以在转换或连接项目的操作之前使用,例如 (Mojave):
Automator(或 TextEdit 就此而言)对于 HTML 编辑来说并不是一个很好的工具。您可以看看 BBEdit(精简版是免费的),它也有出色的 AppleScript 支持。
编辑:
在 运行 AppleScript 操作中使用以下命令使用指定的分隔符组合文本(此示例使用空字符串):
on run {input, parameters}
set separator to "" -- text to separate the items with
set tempTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to separator
set output to input as text
set AppleScript's text item delimiters to tempTID
return output
end run
我正在使用 Automator 创建一个 HTML 页面并且一切正常,但我 运行 遇到了一个小问题。在开始时要求用户提供信息,然后将其设置为变量。该页面是通过使用 Get Specified Text 抓取一些代码并将其复制到剪贴板、获取其中一个变量然后将它们都放入文本文档来创建的。然后重复此过程几次,最终创建一个 HTML 文件。我 运行 遇到了问题,因为 Automator 在指定文本的每一位和每个变量之间创建换行符(可能是回车符 returns?)。所以,我想要的是这样的:
<code grabbed using "Get Specified Text" followed by a Variable. And now some more text and another Variable.>
最终看起来像这样:
<code grabbed using "Get Specified Text" followed by a
Variable
. And now some more text and another
Variable
.>
这将我的页面分成几个部分。有没有办法防止这些换行符?
从一个动作传递到另一个动作的项目在 列表 中,因此设置 TextEdit 内容似乎用换行符分隔各个项目,换行符是正常的段落分隔符.
许多文本操作采用 TextEdit and/or 富文本并且不使用变量(或与其他纯文本操作相处),因此 运行 AppleScript 操作可以在转换或连接项目的操作之前使用,例如 (Mojave):
Automator(或 TextEdit 就此而言)对于 HTML 编辑来说并不是一个很好的工具。您可以看看 BBEdit(精简版是免费的),它也有出色的 AppleScript 支持。
编辑:
在 运行 AppleScript 操作中使用以下命令使用指定的分隔符组合文本(此示例使用空字符串):
on run {input, parameters}
set separator to "" -- text to separate the items with
set tempTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to separator
set output to input as text
set AppleScript's text item delimiters to tempTID
return output
end run