|Aug 2, 2012, 11:25 AM||#1|
How to show/hide objects in Cocoa Applescript application
I need to show/hide things like progress indicators & text fields at various times during the life of the app I'm making. I cannot find anywhere that shows how to do this. It appears as though this existed in the Applescript Studio days with commands like:
set visible of myProgressBar to true
set visible of myProgressBar to false
What is the compatible command for our current versions of XCode?
I'm also looking for a way to switch a Progress Indicator between Intermediate (checked in IB) and Non-Intermediate (not checked in IB) states when the app is running. Is this possible? I need the "barber pole" style view at times and an incremental/numerical progress at other times.
|Aug 2, 2012, 08:14 PM||#2|
You will have to get used to using the Cocoa documentation, since AppleScriptObjC doesn't hide the various classes and methods like AppleScript Studio did.
Don't forget that methods of the parent class(es) can also be used. For progress indicators and text fields, take a look at NSView's setHidden: method.
The NSProgressIndicator class has a setIndeterminate: method that is used to switch to the barber pole.
MacBook Pro / OS X Yosemite (10.10.3) / Xcode 6.2 / RubyMotion FTW
|Aug 3, 2012, 01:12 PM||#3|
As Red Menace has said, most of the UI elements and controls inherit from the NSView class, so you can use the setHidden method to hide or show these controls, also you can use the NSView's isHidden method to find out there current visible status, like this.
property label : missing value --Link to this label in Interface builder property button : missing value --Link to this button in Interface Builder on buttonPressed_(sender) --Link the button to this method in IB if label's isHidden() = 0 label's setHidden_(1) else if label's isHidden() = 1 then label's setHidden_(0) end if end buttonPressed_
Hope this Helps.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Hide OSX System Preferences in Applescript for toggling ignore trackpad in Mavericks?||mactp||Mac Programming||9||Mar 16, 2014 06:03 PM|
|XCode - Cocoa-applescript question||djjasonsa||Mac Programming||3||Feb 21, 2013 03:50 PM|
|Saving a cocoa application to like an executable.||RookieAppler||Mac Programming||16||Feb 11, 2013 11:02 AM|
|General: The apps show up after hide them||Processor||iOS 6||2||Oct 11, 2012 04:58 AM|
|COMBOBOX populate from text file (cocoa applescript)||nicoboss||Mac Programming||4||Jun 29, 2012 01:36 PM|
All times are GMT -5. The time now is 02:36 PM.