Frustrated but optimistic

I have been a grateful user of applescript only recently finding the gem that is applescript studio to build awesome applications with little knowledge of code writing. I am really excited about what I believe will come from this “first class” treatment inside of x-code. But right now I can’t help but vent my frustration where it seems most appropriate. I couldn’t figure out how to change a label through code. I figured it would be a good first “try” especially having the first tutorial that is posted in the unscripted forum. All this to say, “I can’t wait till we get some good books written that break it down the way we’ve had applescript books up till now.”

What kind of “label” are you wanting to change? If you are talking about a button’s title, you change the title:

set title of button "whatever" to "whatnot"

Is this what you mean?

Another way.

on onButtonClick_(sender)
      set title of sender to "New Title"
end onButtonClick_

You can also “bind” the button to a property in your app.
The ScreenCast in Part 2 demonstrates how to create
bindings and Part 4 covers how “setMyButtonTitle” works.

property myButtonTitle : "Click Me" -- Initial title

on onButtonClick(sender)
	-- changes the value of myButtonTitle
	-- which the button is bound to so the
	-- button title is changed
	my setMyButtonTitle_("My Title") 
end onButtonClick_

There are many very cool things we can do with AppleScriptObjC but most require us to learn some Objective-C. There are a lot of things you can accomplish with bindings but at some point learning some Objective-C will still be necessary.

If you have specific questions about any of the tutorials don’t hesitate to ask.


Craig Williams

Thank you both for your responses. I was venting and left out some details as to what I was attempting to do. My only goal was to change the text inside a text field.

This is covered in AppleScriptObjC in Xcode Part 1.