markdown Mac os上下文菜单服务:向mac os上下文菜单添加新服务

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown Mac os上下文菜单服务:向mac os上下文菜单添加新服务相关的知识,希望对你有一定的参考价值。

1. Open up Automator.app located in your Applications folder. 
2. Choose ”Service” in the dialog sheet when creating a new document. 
3. In the `Services receives selected:` menu at the top of the ”Canvas” on the right, change to ”Files & Folders”.
4. In the sidebar to the left, search for `Get Selected Finder Items`
5. Drag this Action to the ”canvas” on the right side.
6. Again, go to the sidebar at the left and this time search for `Run Shell Script`
7. Drag the `Run Shell Script` action to the ”canvas” on the right side.
8. At the right in the `Run Shell Script` action, change the `Pass input` from `to stdin` to `as arguments` 
9. Copy paste this into the action text box, removing the `Cat` command in the text box: 

```
for f in "$@"
do
	/usr/local/bin/code "$f"
done
```

Save the Service into `/Users/yourusername/Library/Services`. Test it by select a file(s) or folder(s) in the Finder and Right-Click 
and go to end at the Context menu labeled ”Services” and look for the name you gave your Service. If everything works alright,
the selected file(s) or folder(s) should have updated modification dates. It doesn't alter
the file(s) or folder(s) except the modification date. 

以上是关于markdown Mac os上下文菜单服务:向mac os上下文菜单添加新服务的主要内容,如果未能解决你的问题,请参考以下文章

markdown Mac上的Subversion(SVN)服务器(OS-X)

如何在 Delphi XE2 中将菜单项添加到 Mac OS Finder

markdown Mac OS X设置。

markdown Mac OS Finder显示/隐藏隐藏文件

markdown 更新基于Mac OS的计算机。

markdown 如何在Mac OS终端中运行JavaScript!