是否有类似于“在这里打开命令窗口”的Mac OS Windows Powertoy ?我通过谷歌搜索找到了几个插件,但想看看哪些最适合开发人员。
当前回答
在OSX 10.6上的AppleScript中有一个错误。(2终端Windows打开)。 我通过在激活后添加关闭命令来解决这个问题。这将关闭第一个终端窗口。
on run
tell application "Finder"
try
activate
set frontWin to folder of front window as string
set frontWinPath to (get POSIX path of frontWin)
tell application "Terminal"
activate
close
do script with command "cd \"" & frontWinPath & "\""
end tell
on error error_message
beep
display dialog error_message buttons ¬
{"OK"} default button 1
end try
end tell
end run
其他回答
此外,您可以使用command-C从查找器中复制一个项目,跳转到终端(例如使用Spotlight或QuickSilver)键入'cd '并简单地使用command-v粘贴
在OSX 10.6上的AppleScript中有一个错误。(2终端Windows打开)。 我通过在激活后添加关闭命令来解决这个问题。这将关闭第一个终端窗口。
on run
tell application "Finder"
try
activate
set frontWin to folder of front window as string
set frontWinPath to (get POSIX path of frontWin)
tell application "Terminal"
activate
close
do script with command "cd \"" & frontWinPath & "\""
end tell
on error error_message
beep
display dialog error_message buttons ¬
{"OK"} default button 1
end try
end tell
end run
如果你安装了Big Cat Scripts (http://www.ranchero.com/bigcat/),你可以添加自己的上下文菜单(右键单击)项。我不认为它带有一个Open Terminal Here applescript,但我使用这个脚本(我不记得是我自己写的,还是从别人的例子中引用的):
on main(filelist)
tell application "Finder"
try
activate
set frontWin to folder of front window as string
set frontWinPath to (get POSIX path of frontWin)
tell application "Terminal"
activate
do script with command "cd \"" & frontWinPath & "\""
end tell
on error error_message
beep
display dialog error_message buttons ¬
{"OK"} default button 1
end try
end tell
end main
类似的脚本还可以通过右键单击获得文件的完整路径,我发现这更有用。
这样的:
https://github.com/jbtule/cdto#cd-to
这是一个小的应用程序,你可以拖到Finder工具栏中,图标非常合适。它使用Terminal, xterm(在X11下),term。
我为finder工具栏创建了一个包含3个应用程序的包。 另外两个应用程序可以做到:
打开当前选择的Textmate 用当前文件夹打开GitX
更多信息请看这里: http://nslog.de/posts/71
推荐文章
- 警告用户/local/mysql/data目录不属于mysql用户
- 崇高的文本从命令行
- 在Mac OS X上使用鼠标聚焦(加上自动提升)
- 我在哪里可以找到Mac OS X Lion的“make”程序?
- 当我没有Mac的时候,在Mac/Safari上测试web应用程序
- 在Mac上安装MySQL后,使用ALTER USER语句重置MySQL root密码
- my.cnf文件在macOS上的位置
- 如何从Mac OS X上卸载MySQL ?
- Git bash错误:无法fork子进程:没有可用的终端(-1)
- 使用grep删除空行
- 查找当前可执行文件的路径,不包含/proc/self/exe
- Git在终端提交时打开VIM,但无法返回终端
- 在Mac上安装R -警告消息:设置LC_CTYPE失败,使用“C”
- 为什么cURL返回错误“(23)Failed writing body”?
- 节点和错误:EMFILE,打开的文件太多