How to put text in an TextField via Applescript in Xcode 4.3?

Hi there,

i am new to this forum and i am new to Xcode 4.

i have a little applescript and want to give it another look so i downloaded Xcode and tried to understand it.:frowning:

I can create the interface, can write the actions and outlets and can put them together.

so what i do not get is the txt field to work.

here is a simple test code from my app:

script AppDelegate
	property parent : class "NSObject"
	property Status :missing value   
    
    on btnClick_(sender)
        set the content of text field "Status" to "Test"
    end btnClick_
    
    
	on applicationWillFinishLaunching_(aNotification)
		-- Insert code here to initialize your application before any files are opened 
	end applicationWillFinishLaunching_
	
	on applicationShouldTerminate_(sender)
		-- Insert code here to do any housekeeping before your application quits 
		return current application's NSTerminateNow
	end applicationShouldTerminate_
	
end script

i do not have any ideas to get text in an label or text box …

is there any human who will take a few minutes an explain me how to get this on work?

thanks in advanced

Michael

P.S. i am german so please forgive my bad english

Hi there,

ok, i have understand it… (i hope)

i had an misstake in my script

wrong

right

here the full code that works fine for me…

script AppDelegate
	property parent : class "NSObject"
    property myLevelInd : missing value
    
    
    on btnHandlerGo_(sender)
    
        
    repeat with i from 5 to 0 by -1
        myLevelInd's setStringValue_(i)
        delay 1
        if i = 0 then
            exit repeat
            quit
        end if
    end repeat  
        
    end btnHandlerGo_
    
            
    
	on applicationWillFinishLaunching_(aNotification)
		-- Insert code here to initialize your application before any files are opened 
	end applicationWillFinishLaunching_
	
	on applicationShouldTerminate_(sender)
		
		return current application's NSTerminateNow
	end applicationShouldTerminate_
	
end script

thanks to all

Michael

First of all, welcome to MacScripter!

That is AppleScript-Studio syntax which you can’t use in AppleScriptObjC (you corrected that in your second post).

Don’t worry, the post(s) were very clear to me.