Are you working with AppleScript Studio or something else? Can we see more code? If you’re actually working with something else and gui scripting that, the text field and formatter might be part of a group or something. Try using a "get properties of text field “blah” and see if it returns anything. If it doesn’t then try to get every “UI element” of the window and “group” of the window and see if you can pinpoint whether the text field is actually part of something else.
Right now all I have is a window with a text field with an attached date formatter and a button.
and an event handler on the button
when the user types something in the text field it gets correctly formatted to a date format
but what i want to do now
is using applescript
when the user clicks the button
in the code part, i set the content of the text field and it should follow the date formatter attached to teh text field
This is a better subject for the AppleScript Studio forum. Having said that.
In Interface Builder, you have placed your button and marked it as clicked in the applescript menu under actions. Also the button needs a name in the applescript section. Then you click edit at the bottom of the inspector window. Xcode comes up with something like this:
on clicked theObject
end clicked
theObject is the the button. To refer to the text field you would then:
on clicked theObject
set contents of text field "blah" of window of theObject to "1/2/3000"
end clicked
This code, however, will change what was typed in by the user. If you want a variable set to what the user typed in then:
on clicked theObject
set x to contents of text field "blah" of window of theObject
end clicked