Automator脚本在Mac OS X上重命名文件 [英] Automator script to rename files on Mac OS X

查看:178
本文介绍了Automator脚本在Mac OS X上重命名文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种简单的方法可以在OS X上使用Automator来用下划线替换文件名中的空格?

解决方案

我已经建立了一个名为重命名项目…"的服务,可以通过在Finder中选择任何项目(或一批项目)来运行,右键单击,然后选择服务>重命名项目...

这很有用,因为在执行操作时它将提供一个小的弹出窗口,您可以在其中选择所需的任何设置(例如,可以使序列顺序,替换文本,添加文本等)

为了为自己创建类似的东西:

  1. 启动自动化器

  2. 在出现提示时,选择服务"模板.

  3. 将重命名查找器项"操作拖放到右侧的工作流区域(您可以通过在Automator左上方的搜索栏中键入重命名"来轻松找到此操作)

  4. 系统将询问您是否要重命名文件时保留文件此服务(保留原始文件)还是只对文件本身进行操作(如果这样做,将无法撤消操作)

  5. 将操作配置为您想要默认提示的任何内容(添加日期或时间",添加文本",更改大小写"等).我选择了按顺序进行"作为默认设置,但您可以选择自己喜欢的任何方式.

  6. 在操作提示框的底部,有3个小按钮(结果,选项,描述).选择选项",然后勾选在工作流运行时显示此操作"框.

  7. 最后,您必须在Automator窗口的顶部配置两个下拉菜单,这些下拉菜单指定此服务将对其起作用.将此设置为:服务在FINDER.APP中接收文件或文件夹"

  8. 保存,就完成了.立即在Finder中选择任何文件,然后在服务"菜单下找到您的新服务(以保存时输入的名称,例如"Rename Items…").无论何时运行该服务,您都会看到一个弹出窗口,允许您您可以配置重命名模式.

Is there an easy way to use Automator on OS X to replace spaces in filenames with underscores?

解决方案

I've set up a service called "Rename Items…" that can be run by selecting any item (or batch of items) in the Finder, right clicking, and then selecting Services > Rename Items…

This is useful as it will provide a small popup window when you perform the action, where you can choose whatever settings you want (for example, you can make the sequence sequential, replace text, add text, etc.)

In order to create something similar for yourself:

  1. launch Automator

  2. when prompted, choose the "Service" template.

  3. drag and drop the Rename Finder Items action to the workflow area on the right (you can find this action easily by typing 'rename' into the search bar in the upper left of Automator)

  4. you will be asked whether you want this service to duplicate files when they are renamed (preserving the originals) or just work on the files themselves (if you do this, your actions will not be undo-able)

  5. configure the action to whatever you want the default prompt to be ("Add Date or Time", "Add Text", "Change Case", etc.) I have selected "Make Sequential" as my default, but you can do whichever you prefer.

  6. At the bottom of the action bubble, there are 3 small buttons (Results, Options, Description). Choose Options, and then tick the box that says "Show this action when the workflow runs")

  7. Lastly, at the top of the Automator window, you must configure two dropdowns that specify what this Service will be active for. Set this to: "Service receives FILES OR FOLDERS in FINDER.APP"

  8. Save and you're done. Select any file in the Finder now, and under the Services menu you will find your new service (under whatever name you gave when saving, eg. "Rename Items…") Whenever you run this service, you will get a popup window that allows you to configure your renaming pattern.

这篇关于Automator脚本在Mac OS X上重命名文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆