Hello everyone!
After re-reading the 1st AppleScriptObjC tutorial, I started experimenting with text fields and such. I was wondering though, how would you set the value for a multi-line label? Let’s say the label first displayed the text “Hello!”, how would after, let’s say, five seconds you program it to display “Goodbye!”. This isn’t for any project of mine but it seems something that MacScripter should include for reference. (Sorry in advance if I glanced over a thread that already answers this question! :P) Hmmm, I predict that it will be something like myLabel’s setStringValue_(“Hello!”), am I right?
property myLabel : missing value
repeat 5 times
--Set myLabel to "Hello!"
delay 5
--Set myLabel to "Goobye!"
end repeat
on applicationWillFinishLaunching_(aNotification)
displayStringOnLabel_("Hello!")
performSelector_withObject_afterDelay_("displayStringOnLabel:","Goodbye!", 5)
end applicationWillFinishLaunching_
on displayStringOnLabel_(aString)
myLabel's setStringValue_(aString)
end displayStringOnLabel_
Also, this isn’t related to this, but would this be how you open a drawer? Yeah, I know really off topic… But still, for some reason, it doesn’t work for me!
Okay, I made a new project and tried it on there, no luck. I have the parentWindow, the contentView, and a button called buttonWorks. This is my script:
script testAppDelegate
property parent : class "NSObject"
property theDrawer : missing value
on buttonWorks_(sender)
theDrawer's |open|()
end buttonWorks_
on applicationWillFinishLaunching_(aNotification)
end applicationWillFinishLaunching_
on applicationShouldTerminate_(sender)
-- Insert code here to do any housekeeping before your application quits
return current application's NSTerminateNow
end applicationShouldTerminate_
It’s important that the property theDrawer is connected to the NSDrawer object
and parentWindow of the NSDrawer object is connected to the proper window or panel object
Yep, it seems like I’m crazy :P… But I swear I just dragged in a window & drawer set from my Library and some how it worked. But when I manually try to create a window and drawer it doesn’t work. It’s going to be a pain to drag all my stuff from my original window to the other window but I guess I’ll have to live with it. I don’t know what happened though… Interface Builder can really be mean to me…
OH WHY??? Okay, I think I might be going crazy, but now I guess it won’t work. I will find a way but thanks a lot Stefan for trying to help! I really appreciate it.
Hmm, one more question ( I know I’ve asked a lot!). Is there anyway that you can make a progress indicator larger than the “regular” setting in Interface Builder?