在Mac OS X Finder中创建符号链接

迈克尔·施耐德(Michael Schneider)

有没有办法获得与ln -sMac OS X Finder(OS 10.5)中的unix命令相同的功能我希望能够在Finder窗口中工作时创建符号链接,而无需打开终端。

请注意,Make AliasFinder中的命令不是我想要的,因为这些别名无法在终端中导航(但是ln -s,使用终端和Finder都可以导航使用创建的链接)。

核桃

通过AppleScript在Finder创建符号链接又如何呢?

这是该链接中最相关的脚本:

on run
    open {choose file with prompt "Choose a file to create a symbolic link:" without invisibles}
end run

on open the_files
    repeat with i from 1 to (count the_files)
        try
            set posix_path to POSIX path of (item i of the_files)
            if posix_path ends with "/" then set posix_path to text 1 thru -2 of posix_path
            do shell script "ln -s " & quoted form of posix_path & " " & quoted form of (posix_path & ".sym")
        end try
    end repeat
end open

只需将其粘贴到AppleScript编辑器中,然后将其另存为应用程序即可然后,您可以将其拖到搜索器的工具栏上,或将其链接到扩展坞上

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章