petit problème applescript studio

clampin

Membre expert
Club iGen
22 Septembre 2000
1 002
177
53
Louvain-La-Neuve, Belgique
www.clampin.com
hello,

j'ai créé une application applescript studio et j'ai un petit problème.

Dans ma fenêtre j'ai créer un champ nommé urlTextField et un bouton appelé goButton.

et voici le code du bouton

Bloc de code:
on clicked theObject
	tell window of theObject
		try
			set theUrl to contents of text field "urlTextField" as text
			tell application "Safari"
				open location theUrl
			end tell
		end try
	end tell
end clicked

Pourquoi ça ne marche pas... il devrai m'ouvrir safari et ouvrir l'url tapé dans le champ urlTextField non ?
 
Ta fenetre principale s'appellant "mainWindow", voici le code :

Bloc de code:
on clicked theObject
	tell window "mainWindow"
		set theUrl to contents of text field "urlTexField" as text
		tell application "Safari"
			open location theUrl
		end tell
	end tell
end clicked

Cordialement