2012-08-02 2 views

답변

3

Maverics 그것은 애플 스크립트에서 알림을 트리거하는 것이 가능하지만 산 사자에 작동하는지 확실하지 :

display notification "Hello!" 

나는 사과 스크립트에 매개 변수를 전달하는 간단한 명령 줄 스크립트를했다. 한 줄 설치 :

echo -e '#!/bin/bash\n/usr/bin/osascript -e "display notification \"$*\""'|sudo -s "cd /usr/local/bin;tee notify&&chmod +x notify" 

아래 코드를/usr/local/bin (반드시 존재해야 함)에 출력하고 실행 가능 플래그를 추가합니다./usr/local/bin이 $ PATH에 있는지 확인하십시오.

notify "Lorem ipsum dolor sit amet" 
sleep 5 ; notify "Slow command finished" 
: 이제
#! /bin/bash 
/usr/bin/osascript -e "display notification \"$*\"" 

알림을 표시합니다
관련 문제