Sunday, December 9, 2012

AppleScript에서 외부 스크립트 파일 사용하는 법

      set dirname to myGetAppleScriptRootPath()  
      set filepath to dirname & "/" & scriptFilename  
      set myScript to load script (filepath as POSIX file)  

이렇게 한 후 myScript's functionName() 과 같이 호출해서 쓰면 됨.
참고로 현재 스크립트의 패스를 얻는 myGetAppleScriptRootPath() 는 다음과 같음

 on myGetAppleScriptRootPath()  
      set thisScriptPath to POSIX path of (path to me)  
      set dirname to do shell script "dirname " & quoted form of thisScriptPath  
      return dirname  
 end myGetAppleScriptRootPath  

키워드 : 외부 라이브러리

No comments:

Post a Comment