Macとかの雑記帳

シンボリックリンクを作るApplescript。Automatorでサービスとして保存してコンテクストメニューから使用するもので、単体ではつかえない。どこで入手したか忘れたが、消えてしまったときのためにメモ。

 

on run {input, parameters}
(* Your script goes here *)
tell application "Finder"
set theinput to item 1 of input as alias
set theInfo to info for theinput
set theName to name of theInfo
set inpath to "\"" & (POSIX path of
(theinput)) & "\""
choose folder with prompt "Choose Destination Folder"
set outpath to "\"" & (POSIX path of
(result)) & theName & "\""
end tell
do shell script "ln -s " & inpath & " " & outpath
return input
end run

スポンサード リンク