(informal protocol)
Framework | /System/Library/Frameworks/AppKit.framework |
Companion guide | |
Declared in | NSWindowScripting.h |
Category on NSWindow
. Supports window scripting for all scriptable Cocoa applications by getting and setting standard properties and handling the close
, print
, and save
AppleScript commands.
– hasCloseBox
– hasTitleBar
– isFloatingPanel
– isMiniaturizable
– isModalPanel
– isResizable
– isZoomable
Handles the close
AppleScript command by attempting to close the window (and its associated document, if any).
- (id)handleCloseScriptCommand:(NSCloseCommand *)command
Extracts close
command arguments from the command object and uses them to determine how to close the associated document—specifically, whether to ignore unsaved changes, save changes automatically, or ask the user and to identify the file in which to save the document (by default, the file that was opened or previously saved to, or an “untitled” name if the file has never been saved).
If there is a corresponding document and the window is the main window of the document, it forwards the close
command to the corresponding document; otherwise, the window sends itself a performClose
message, if it has a close box. This may have been handled differently in versions of Mac OS X prior to version 10.3.
NSWindowScripting.h
Handles the print
AppleScript command by attempting to print the contents of the window (or its associated document, if any).
- (id)handlePrintScriptCommand:(NSScriptCommand *)command
If there is a corresponding document and the window is the main window of the document, it forwards the print
command to the corresponding document; otherwise, the window sends itself a print
message. This may have been handled differently in versions of Mac OS X prior to version 10.3.
NSWindowScripting.h
Handles the save
AppleScript command by attempting to save the window (and its associated document, if any).
- (id)handleSaveScriptCommand:(NSScriptCommand *)command
The default version invokes the same named method of the window's document, if the window is the one being saved.
NSWindowScripting.h
Returns YES
if the receiver has a close box.
- (BOOL)hasCloseBox
NSWindowScripting.h
Returns YES
if the receiver has a title bar.
- (BOOL)hasTitleBar
NSWindowScripting.h
Returns YES
if the receiver is a floating panel.
- (BOOL)isFloatingPanel
NSWindowScripting.h
Returns YES
if the receiver can be miniaturized (has a minimize button).
- (BOOL)isMiniaturizable
NSWindowScripting.h
Returns YES
if the receiver is an application-modal panel.
- (BOOL)isModalPanel
NSWindowScripting.h
Returns YES
if the receiver is resizable (has a size control).
- (BOOL)isResizable
NSWindowScripting.h
Returns YES
if the receiver is zoomable (has a zoom button).
- (BOOL)isZoomable
NSWindowScripting.h
Returns the zero-based position of the receiver based on its order from front to back among all application windows.
- (int)orderedIndex
NSWindowScripting.h
Sets the receiver’s miniaturized state to the value specified by flag.
- (void)setIsMiniaturized:(BOOL)flag
Depending on the current miniaturized state and the value of flag, the window may be minimized to the Dock or expanded from the Dock.
NSWindowScripting.h
Sets the receiver’s visible state to the value specified by flag.
- (void)setIsVisible:(BOOL)flag
NSWindowScripting.h
Sets the receiver’s zoomed state to the value specified by flag.
- (void)setIsZoomed:(BOOL)flag
NSWindowScripting.h
Sets the zero-based position of the receiver, based on its order from front to back among all visible application windows, to the value specified by index. If index is out of range, sets the position to the nearest value that is in range.
- (void)setOrderedIndex:(int)index
NSWindowScripting.h
© 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-05-23)