AppleScript Application In Xcode - Error -10006

I am trying to get my first AppleScript Application going with xCode and I can’t get past my first hurdle.

I have a textField in the default window titled “Server Launcher” with an Ok button on it and everytime I click ok I get:

following is the code:


-- ServerLauncher.applescript
-- ServerLauncher

--  Created by Jeffery Fernandez on 24/05/09.
--  Copyright 2009 Jeffery Fernandez All rights reserved.

on clicked theObject
	
	
	set contents of text field "userFullName" of window "Server Launcher" to "Jeffery Fernandez" as string
	
	tell window "Server Launcher"
		
		#set the contents of text field "userFullName" to "Jeffery Fernandez"
		
	end tell
end clicked

From what I have understood so far, the interface is made of containers which are:

Window > View > TextField

I have put the name of the TextField in the “Interface Builder Identity”. Have I got that wrong?

Any help appreciated.

cheers,
Jeffery

Model: MacBookPro
Browser: Firefox 3.0.10
Operating System: Mac OS X (10.5)

Hi Jeffrey,
as far as I understand you are using AppleScript Editor to execute this code. But AS doesn´t understand this code. To make this work you need AppleScript Studio and XCode (which is on your Leopard DVD) and you have to setup a nib document using inteface builder.

Greetings, Ronald

Hi Ronald,

I am using XCode and the Interface builder as my topic mentioned. Anyway I got around my first hurdle after a “few” hours of experimenting.

The problem was with the name of the TextField. I didn’t realise that there are two modes for the Interface Designer. If you just click the TextField in the Designer once it shows the Attributes Inspector Window as “Text Field AppleScript” but if you click once more, it shows: “Text Field Cell AppleScript”

I was using the latter one to register the Text Fields name, which is wrong.

Now on to more experimenting…

cheers,
Jeffery