민서네집

AppleScript Finder tip - Get the full path of the Finder 본문

Mac

AppleScript Finder tip - Get the full path of the Finder

브라이언7 2014. 8. 12. 22:49

[출처] http://alvinalexander.com/blog/post/mac-os-x/applescript-finder-full-path-clipboard


Finder 가 실행된 상태에서 이 Apple Script를 실행시키면 Dialog 창이 뜨고 그 창에 Clipboard 버튼이 생긴다. 그 버튼을 누르면 클립보드에 Finder의 전체 경로가 들어간다.

이 스크립트를 app으로 저장하고, Finder에서 저장한 app파일을 선택해서 FInder의 툴바로 끌면 버튼이 생긴다. 이 후로는 Finder에서 이 버튼을 누르면 이 스크립트가 자동으로 실행된다.


tell application "Finder"
	set theWindow to window 1
	set thePath to (POSIX path of (target of theWindow as alias))
	display dialog thePath buttons {"Clipboard", "OK"} default button 2
	if the button returned of the result is "Clipboard" then
		set the clipboard to thePath
	end if
end tell


Apple Script (확장자 scpt) 파일을 Compile 해서 확장자가 app 인 파일을 만들어서 Finder 의 Tool Bar 로 Drag 해서 등록하면 된다.


'Mac' 카테고리의 다른 글

Mac 팁(Tip)  (0) 2014.08.21
Mac Finder Service 등록 - Copy Path as Text  (0) 2014.08.16
cd to.app 설치 (Mac Mavericks)  (0) 2014.08.12
[mac] Parallels 9 인증 받기  (3) 2014.08.10
MacBook Trackpad Util for Windows  (0) 2014.08.10
Comments