macos 如何使用自动机在 mac osx 上制作液滴?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3087148/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 07:01:11  来源:igfitidea点击:

How to make a droplet on mac osx with automator?

macosapplescript

提问by Kreker

I readed some tutorials about making droplets with apple script or with automator's help. First, I need to know if these droplets only works with the drag n drop file action, or if you can do the action in the current directory you are.And if the last answer is yes, how to do with automator? This was a general question.

我阅读了一些关于使用 Apple 脚本或在 automator 的帮助下制作液滴的教程。首先,我需要知道这些 droplets 是否只适用于拖放文件操作,或者您是否可以在当前目录中执行该操作。如果最后一个答案是肯定的,那么如何使用 automator?这是一个普遍的问题。

In my case. I need a droplet in my finder toolbar that when I click on in it search for all file with a specific extensions and drop to trash. I try with automator but I can't fine the action for selecting files in the current directory, only found the general find. Because I will can be in any other possible directory I need to know how to do this. It's not a problem writing some applescript, I don't know it but I can learn:)

就我而言。我的查找器工具栏中需要一个 Droplet,当我单击它时,它会搜索具有特定扩展名的所有文件并将其放入垃圾箱。我尝试使用 automator,但我无法执行在当前目录中选择文件的操作,只能找到一般查找。因为我可以在任何其他可能的目录中,所以我需要知道如何做到这一点。写一些applescript不是问题,我不知道,但我可以学习:)

回答by kiamlaluno

To create a droplet with Automator, you select application, when Automator asks you what you want to create.

要使用 Automator 创建 Droplet,当 Automator 询问您要创建什么时,您选择应用程序。

The description given by the application, when you select application is the following:

当您选择应用程序时,应用程序给出的描述如下:

Applications are self-running workflows. Any files or folders dropped onto an Application will be used as input to the workflow.

应用程序是自运行的工作流。放到应用程序上的任何文件或文件夹都将用作工作流的输入。

I think it means that only dropped files / directory will be passed to the workflow. I tested it, and I can confirm it works in that way.

我认为这意味着只有丢弃的文件/目录才会传递给工作流。我测试了它,我可以确认它以这种方式工作。