10.3 and 10.4 - download a file then upload using Terminal

Hey,
I need a script that would run on both Tiger and Panther. For some reason, my script refuses to run on tiger. I need to get the upload rate so i’ve decided using the terminal commands. the script is intended to run on various computers so i can’t use do shell script and call for a script that lies somewhere on the harddrive…
the script is as follows:


display dialog "Start Upload Test?" buttons {"OK", "Cancel"} default button 1
if button returned of result = "Cancel" then
	beep 1 and end
else if button returned of result = "OK" then
end if
set newFile to "test"
tell application "URL Access Scripting"
	activate
	download "http://domain.net/file.text" to newFile replacing yes with progress
end tell

tell application "Terminal"
	activate
	do script " ftp ftp://user:password@server
	put /test"
	close window 2
end tell

tell application "Terminal"
	do script "bye" in window 1
end tell

set isBusy to true
repeat until isBusy is false
	tell application "Terminal"
		tell window 1
			set isBusy to busy as boolean
		end tell
	end tell
	delay 1
end repeat

if isBusy is false then
	tell application "Finder"
		delete "test"
	end tell
end if

any suggestions?

:slight_smile:

You can pass shell script via do shell scrpt.

do shell script "ls"

ok and then what? do shell script ftp and then another “do shell script”??
how can i retrieve the results and display them? have you any idea why my scripts works perfectly on panther and not on tiger?
thanks for replying :slight_smile: