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!"
--Set myLabel to "Goobye!"
You are, something like this
So, if I were to do this, it would be correct?
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!
to open a drawer programmatically, use the open() method (without parameter);
It could be that the pipes are necessary
the open_() method with parameter is used as an action method to be connected to an UI element
Hmmm, I tried it and the same result… Here is the full script:
property theDrawer: missing value
set theApp to (choose application)
set theID to theApp
the code should work.
Is the drawer properly connected in Interface Builder
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:
property parent : class "NSObject"
property theDrawer : missing value
-- Insert code here to do any housekeeping before your application quits
return current application's NSTerminateNow
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
you can also connect the sent action of the button directly to the open: action of the drawer
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.
when you drag a drawer object from the Library you get three objects: a Window , a Drawer Content View and a Drawer.
If you want to use another window, delete the Window object and connect the parentWindow property of the Drawer object to the window you want to use
Thanks, I’ve got it to work!
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?