원본 포스트는 다음과 같습니다.
http://mattrajca.com/post/9821989578/auto-ejecting-disc-image-files-dragged-to-the-trash
Automator와 OS X의 Folder Action 기능을 사용하여서 Disc Image를 휴지통에 넣으면 자동으로 언마운트 시켜주것을 만들어 보겠습니다.
휴지통은 ~/.Trash로서 숨겨져서 Other...을 선택합니다.
~/.Trash 를 입력후 Go를 클릭합니다.
Shell은 /usr/bin/python Pass input은 as arguments 를 선택합니다.
import string, os, sys lines = os.popen("hdiutil info").readlines() should_eject = False for line in lines: if line.startswith("image-alias"): path = line.split(":")[1] image_path = path.lstrip().rstrip() if image_path in sys.argv: should_eject = True elif line.startswith("/dev/") and should_eject is True: os.popen("hdiutil eject %s" % line.split()[0]) should_eject = False elif line.startswith("###"): should_eject = False
적용 해제 방법.
'iLife' 카테고리의 다른 글
iPad 1세대, iPod Touch 4세대에 iPhoto for iOS 설치하기 (2) | 2012.03.13 |
---|---|
iOS 5 beta로 iPad 출시 추측 (0) | 2012.02.19 |
[TIP] iTunes Producer로 iBookstore에 한글제목 책 올리기 (0) | 2012.01.26 |
iTunes Producer 간단 사용법 및 iTunes Store에 업로드 하기 (3) | 2012.01.24 |
iBooks Author를 위한 Free Books 계정 생성 (0) | 2012.01.23 |