I am new to AppleScript ObjC, I only briefly got my feet wet with Applescript Studio. I have however worked with applescript for almost a year. After reading through all of the tutorials posted up I still have some questions that I would really appreciate help with. I am sure that they are simple questions but I still haven’t been able to find the answers by reading the other threads in this forum. It seems most users on this forum are working on far more advanced projects than me.
Question #1
In applescript studio I was able to set key equivalents by running the following code:
on keyboard up theObject event theEvent
set key equivalent of button "myButton" of window "myWindow" to return
end keyboard up
I haven’t been able to figure this out yet in Applescript ObjC.
Question #2
This is another easy one that I feel slightly embarrassed about asking. I have searched and looked at the examples and still don’t get it. (All of the examples in the tutorials show the textfield changing as the result of a button being pressed) I am trying to set the content of a text field on the launch of the application. In Applescript Studio, I would attach a line or two in the awake on nib section as follows:
on awake from nib theObject
set contents of text field "myTextfield" of window "myWindow" to "Whatever content I want"
end awake from nib
I have been able to learn that awake from nib has changed to:
on awakeFromNib()
------Magic code that makes this work!
end awakeFromNib
I have tried sticking in
"set myTextfield's content to "Whatever content I want"
This is not working since I must be missing something important. The information I am looking to put into the textfield will not be static it will be different each time the application is launched.
Can someone shed some light on these for me? I would really appreciate it.
Sincerely,
Confused