有没有办法获得与ln -s
Mac OS X Finder(OS 10.5)中的unix命令相同的功能?我希望能够在Finder窗口中工作时创建符号链接,而无需打开终端。
请注意,Make Alias
Finder中的命令不是我想要的,因为这些别名无法在终端中导航(但是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] 删除。
我来说两句