[n00b] Can anyone tell me why I get an error at this line?


on action theObject
		set ip_address to contents of text field "ipaddress"
		set disk_name to contents of text field "harddisk"
		set dvd_folder to contents of text field "dvdfolder"
		set user_name to contents of text field "usernm"
		set passwd to contents of text field "passwd"
		repeat until (exists disk disk_name)
		activate application "Finder"
		mount volume "afp://" & ip_address & "/" & disk_name as user name user_name with password passwd
		end repeat
end action


on clicked theObject
	tell application "Finder"
	set film_folder to disk_name & ":" & dvd_folder
	set list_films to name of every folder of folder film_folder
	set NSPopUpButton to list_films
	choose from list list_films with prompt "Choose the film you wish to play."
	set chosen_film to result
	set play_film to film_folder & ":" & chosen_film & ":VIDEO_TS" as alias
end tell

	tell application "DVD Player"
		activate
		set viewer full screen to true
		open VIDEO_TS play_film
		play dvd
	end tell
end clicked

i get an error at the line that says repeat until (exists disk disk_name) and I have no idea why. This script worked fine in normal applescript but now in ASS I get this error… ??

The error I get is "Expected “,” but found identifier. (-2741)

If I take the “repeat until” and “end repeat” lines out the script compiles but when I click my “Mount Media” button I get an error that says

“The variable disk_name is not defined”

AAARGH!

Is it better from a design standpoint to have a seperate script for every button?

With the help of a friend we’ve figured out the script only works if the values for ip_address etc are hard coded into the routine. Any ideas why it doesn’t work using the values from the text fields? Or any suggestions as to how to enable the user to enter those values?

TIA

Alistair

Problem solved: I had to change the contents to content DOH!