Applescript and Terminal

本區專門提供 Mac OS X 使用者交換使用心得

版主: ross_ttbryanchangdigdogchester

回覆文章
內容
發表人
xiKoun
新生訓練中
文章: 3
註冊時間: 02/16/2002 1:01 am
來自: Taipei

Applescript and Terminal

#1 文章 xiKoun »

在Applescript呼叫Terminal
利用wget 下載,如下

tell application "Terminal"

repeat with n from 1 to 5

do script with command "wget [url=http://www.xxx.org/bsd"]http://www.xxx.org/bsd"[/url] & 200+n &".jpg"

end

end tell


這樣會出現五個Terminal

請問要如何修改使所有的下載過程可以都在一個Terminal內

Really thanks
頭像
bryanchang
討論區管理員
文章: 7057
註冊時間: 04/19/2001 1:01 am
來自: The '60s
聯繫:

Applescript and Terminal

#2 文章 bryanchang »

寫一個 Shell script 去做下載 n 次的動作,然後用 AppleScript 去叫那個 shell script, 同時在參數列提供 n 的值。
留言五百如一日
文章: 610
註冊時間: 12/25/2001 1:01 am

Applescript and Terminal

#3 文章 »

xiKoun,

用 applescript 呼叫 Terminal, 每一個呼叫會開一個新 Terminal.

So, with unix, try :

1. 修改 unix command, do the download in one script in one time.
2. 用 "do shell script"*, if 用 applescript 1.8.1.

without unix, try :

3. 用 URL Access Scripting.
4. 用 "open location".


* do shell script uses the sh shell, which is different than the default tcsh shell used in the Terminal.
回覆文章