Sunday, March 21, 2010

AppleScript에서 File Open Dialog Box 스타일로 파일명 얻어내기

choose file 을 사용하면 된다.
choose file AppleScript 로 이미지 리사이즈하는 코드 자동생성하기 에 처음 나왔다.

Prompt 를 함께 주려면 다음과 같이 한다.
set TheFile to (choose file with prompt "Choose a file for Conversion")
set the_posix_file to POSIX path of TheFile
display dialog the_posix_file
텍스트 파일만 얻어내려면
set TheFile to (choose file with prompt "Select the file:" of type {"TEXT"}) as string
display dialog TheFile

No comments:

Post a Comment