简体   繁体   English

Automator AppleScript操作将忽略输入

[英]Automator AppleScript action ignores input

I have an Automator workflow that returns a list, an NSArray of NSString s, in the example below "FN3", "VN3", "NN3", "organization", and "notCancelled" (sorry for the German, but I think the image is clear anyway). 我有一个Automator工作流程,该工作流程返回一个列表,一个NSStringNSArray ,在下面的示例中为“ FN3”,“ VN3”,“ NN3”,“ organization”和“ notCancelled”(对不起,德语,但我认为图像仍然清晰)。
This list is input to an AppleScript action, which for testing purposes simply returns the input. 此列表是AppleScript操作的输入,出于测试目的,该操作仅返回输入。 This AppleScript action does not ignore the input (this is indicated by the link between both actions). 此AppleScript操作不会忽略输入(两个操作之间的链接表明了这一点)。
Strangely, the output is an empty list: 奇怪的是,输出是一个空列表:
在此处输入图片说明 What am I doing wrongly? 我做错了什么?

UPDATE: 更新:

I just realized the following: 我刚刚意识到以下几点:
When I use my own Obj-C action as input to the AppleScript action, the log file says between the end of my action, and the begin of the AppleScript action (translated): "Conversion of files/folders to files/folders terminated". 当我使用自己的Obj-C动作作为AppleScript动作的输入时,日志文件会在动作结束和AppleScript动作开始之间进行翻译(翻译):“文件/文件夹到文件/文件夹的转换已终止” 。
When I replace my own Obj-C action by a standard "Ask for text" action, everything works fine, and the log message before the AppleScript action says (translated): "Conversion of text to text terminated". 当我用标准的“询问文本”操作替换我自己的Obj-C操作时,一切正常,并且AppleScript操作之前的日志消息说(翻译):“文本转换为文本终止”。
So, apparently, my Obj-C action returns something in the wrong format. 因此,显然,我的Obj-C操作返回的格式错误。 What is the correct one? 正确的是什么?

I found the problem: 我发现了问题:
My Obj-C action had in its Info.plist a wrong output type specified. 我的Obj-C动作在其Info.plist中指定了错误的输出类型。 By default, it was: 默认情况下,它是:

在此处输入图片说明

For this reason, a conversion action tried to convert paths (which the action does not provide) to an appropriate input for the AppleScript action. 因此,转换操作试图将路径(该操作未提供)转换为AppleScript操作的适当输入。

The correct setting is (in my case): 正确的设置是(以我为例):

在此处输入图片说明

With this setting, the AppleScript action correctly outputs the input strings. 使用此设置,AppleScript操作可以正确输出输入字符串。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM