2017-04-01 3 views
0

에서 실행되지 않습니다AppleScript로 왜 터미널에서 내 AppleScript로 실행 내가</p> <p>내가 명령을 실행 편집기에서 성공적으로 실행할 수 없습니다 터미널

/usr/bin/osascript -e my_script.scpt 

나는 오류를

0시 12분를 얻을 수 : 구문 오류 : 알 수없는 토큰은이 식별자 뒤에 올 수 없습니다. (-2740)

내 스크립트

set volume 2 
set x to 0 
open location "spotify:user:wunspe:playlist:meininki" 
tell application "Spotify" 
    set the sound volume to 0 
    play 
    repeat 10 times 
     if sound volume is less than 70 then 
      set sound volume to (sound volume + 10) 
      set x to (x + 9) 
      set volume output volume x without output muted --100% 

      delay 3 
     end if 
    end repeat 



end tell 

답변

3

당신이 -e 플래그를 생략하고 스크립트

/usr/bin/osascript /Users/myUser/path/to/my_script.scpt 
+0

로 스크립트 파일을 호출 할 수 있습니다

set Volume 10 

(IT volume.scpt를 호출 할 수 있습니다). – wpj

0

당신이 쓰는 경우의 전체 경로를 통과해야 컴파일 된 스크립트 (파일)을 실행하려면

osascript -e "set Volume 10" 

-e은 스크립트의 전체 내용입니다. 일부 파일에 넣을 경우

지금 작동 감사합니다 당신이

osascript /path/to/volume.scpt