문제

I'm trying to use Applescript to open up terminal and make terminal run the commands given. Here is my code:

tell application "Terminal"
set currentTab to do script ("cd Desktop\")
delay 6
do script ("python2.7-32 snake.py") in currentTab
end tell

When I go and enter it into terminal manually, it works! But when I try to do it in apple script, it gives me an error what says "Expected “,” but found identifier."

How do I fix this?

도움이 되었습니까?

해결책

Just a guess but that backslash in ("cd Desktop\") will escape the double quote, which is probably upsetting the parser.

This is not Windows, so the path separator is forward slash ("cd Desktop/").

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top