Rupert

::Me(C#,VC,MonoTouch,MonoforAndroid);

导航

Applescript

Posted on 2014-11-03 21:45  ArRan  阅读(192)  评论(0编辑  收藏  举报

Q:我如何在一句do shell script里使用多条指令?比如我想要先cd到某目录,然后在该目录里做一些操作,但是分次调用do shell script不会记住上次的工作路径。 

A:每次对do shell script的调用都是一个新的进程,所以前一次调用里改变的路径无法对下一次调用生效。想要在一次调用中做多个操作,请用分号隔开不同的操作指令,如下 

 

 

Applescript代码

 

    1. do shell script "cd ~/Documents; ls"  

    2. -- result: "Welcome.txt"