diff --git a/DTerm.xcodeproj/project.pbxproj b/DTerm.xcodeproj/project.pbxproj index f181038..4452791 100644 --- a/DTerm.xcodeproj/project.pbxproj +++ b/DTerm.xcodeproj/project.pbxproj @@ -127,7 +127,6 @@ 2529F76D0CF4D61100CDF456 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = ""; }; 2529F8500CF5F6AB00CDF456 /* DTerm.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = DTerm.icns; sourceTree = ""; }; 2529F8E90CF7575000CDF456 /* Terminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Terminal.h; sourceTree = ""; }; - 252FA10D1141A4D00043EA6C /* iTerm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iTerm.h; sourceTree = ""; }; 254036C510FFCDCC0076CE83 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = ""; }; 2559EB0E0D36EC58002BCF4E /* PathFinder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathFinder.h; sourceTree = ""; }; 257158E70CFF9A99007181F4 /* DTShellUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTShellUtilities.h; sourceTree = ""; }; @@ -285,7 +284,6 @@ 2500756D0CF0C1CF00949B95 /* Finder.h */, 2559EB0E0D36EC58002BCF4E /* PathFinder.h */, 2529F8E90CF7575000CDF456 /* Terminal.h */, - 252FA10D1141A4D00043EA6C /* iTerm.h */, 25FA394212E5E47100DE744A /* iTerm2.h */, 75B0EC781A022E5900C023D1 /* iTerm2Nightly.h */, 75BDB76D1A07EAA9006BB694 /* SystemEvents.h */, diff --git a/ScriptingBridge/iTerm.h b/ScriptingBridge/iTerm.h deleted file mode 100644 index b667898..0000000 --- a/ScriptingBridge/iTerm.h +++ /dev/null @@ -1,278 +0,0 @@ -/* - * iTerm.h - */ - -#import -#import - - -@class iTermItem, iTermITermApplication, iTermColor, iTermDocument, iTermWindow, iTermAttributeRun, iTermCharacter, iTermParagraph, iTermText, iTermAttachment, iTermWord, iTermSession, iTermTerminal, iTermPrintSettings; - -enum iTermSavo { - iTermSavoAsk = 'ask ' /* Ask the user whether or not to save the file. */, - iTermSavoNo = 'no ' /* Do not save the file. */, - iTermSavoYes = 'yes ' /* Save the file. */ -}; -typedef enum iTermSavo iTermSavo; - -enum iTermEnum { - iTermEnumStandard = 'lwst' /* Standard PostScript error handling */, - iTermEnumDetailed = 'lwdt' /* print a detailed report of PostScript errors */ -}; -typedef enum iTermEnum iTermEnum; - - - -/* - * Standard Suite - */ - -// A scriptable object. -@interface iTermItem : SBObject - -@property (copy) NSDictionary *properties; // All of the object's properties. - -- (void) closeSaving:(iTermSavo)saving savingIn:(NSURL *)savingIn; // Close an object. -- (void) delete; // Delete an object. -- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. -- (BOOL) exists; // Verify if an object exists. -- (void) moveTo:(SBObject *)to; // Move object(s) to a new location. -- (void) saveAs:(NSString *)as in:(NSURL *)in_; // Save an object. -- (void) execCommand:(NSString *)command; // Executes a command in a session (attach a trailing space for commands without carriage return) -- (void) launchSession:(NSString *)session; // Launches a default or saved session -- (void) select; // Selects a specified session -- (void) terminate; // Terminates a session -- (void) writeContentsOfFile:(NSString *)contentsOfFile text:(NSString *)text; // Writes text or file contents into a session - -@end - -// An application's top level scripting object. -@interface iTermITermApplication : SBApplication - -- (SBElementArray *) documents; -- (SBElementArray *) windows; - -@property (readonly) BOOL frontmost; // Is this the frontmost (active) application? -@property (copy, readonly) NSString *name; // The name of the application. -@property (copy, readonly) NSString *version; // The version of the application. - -- (iTermDocument *) open:(NSURL *)x; // Open an object. -- (void) print:(NSURL *)x printDialog:(BOOL)printDialog withProperties:(iTermPrintSettings *)withProperties; // Print an object. -- (void) quitSaving:(iTermSavo)saving; // Quit an application. - -@end - -// A color. -@interface iTermColor : iTermItem - - -@end - -// A document. -@interface iTermDocument : iTermItem - -@property (readonly) BOOL modified; // Has the document been modified since the last save? -@property (copy) NSString *name; // The document's name. -@property (copy) NSString *path; // The document's path. - - -@end - -// A window. -@interface iTermWindow : iTermItem - -@property NSRect bounds; // The bounding rectangle of the window. -@property (readonly) BOOL closeable; // Whether the window has a close box. -@property (copy, readonly) iTermDocument *document; // The document whose contents are being displayed in the window. -@property (readonly) BOOL floating; // Whether the window floats. -- (NSInteger) id; // The unique identifier of the window. -@property NSInteger index; // The index of the window, ordered front to back. -@property (readonly) BOOL miniaturizable; // Whether the window can be miniaturized. -@property BOOL miniaturized; // Whether the window is currently miniaturized. -@property (readonly) BOOL modal; // Whether the window is the application's current modal window. -@property (copy) NSString *name; // The full title of the window. -@property (readonly) BOOL resizable; // Whether the window can be resized. -@property (readonly) BOOL titled; // Whether the window has a title bar. -@property BOOL visible; // Whether the window is currently visible. -@property (readonly) BOOL zoomable; // Whether the window can be zoomed. -@property BOOL zoomed; // Whether the window is currently zoomed. - - -@end - - - -/* - * Text Suite - */ - -// This subdivides the text into chunks that all have the same attributes. -@interface iTermAttributeRun : iTermItem - -- (SBElementArray *) attachments; -- (SBElementArray *) attributeRuns; -- (SBElementArray *) characters; -- (SBElementArray *) paragraphs; -- (SBElementArray *) words; - -@property (copy) NSColor *color; // The color of the first character. -@property (copy) NSString *font; // The name of the font of the first character. -@property NSInteger size; // The size in points of the first character. - - -@end - -// This subdivides the text into characters. -@interface iTermCharacter : iTermItem - -- (SBElementArray *) attachments; -- (SBElementArray *) attributeRuns; -- (SBElementArray *) characters; -- (SBElementArray *) paragraphs; -- (SBElementArray *) words; - -@property (copy) NSColor *color; // The color of the first character. -@property (copy) NSString *font; // The name of the font of the first character. -@property NSInteger size; // The size in points of the first character. - - -@end - -// This subdivides the text into paragraphs. -@interface iTermParagraph : iTermItem - -- (SBElementArray *) attachments; -- (SBElementArray *) attributeRuns; -- (SBElementArray *) characters; -- (SBElementArray *) paragraphs; -- (SBElementArray *) words; - -@property (copy) NSColor *color; // The color of the first character. -@property (copy) NSString *font; // The name of the font of the first character. -@property NSInteger size; // The size in points of the first character. - - -@end - -// Rich (styled) text -@interface iTermText : iTermItem - -- (SBElementArray *) attachments; -- (SBElementArray *) attributeRuns; -- (SBElementArray *) characters; -- (SBElementArray *) paragraphs; -- (SBElementArray *) words; - -@property (copy) NSColor *color; // The color of the first character. -@property (copy) NSString *font; // The name of the font of the first character. -@property NSInteger size; // The size in points of the first character. - - -@end - -// Represents an inline text attachment. This class is used mainly for make commands. -@interface iTermAttachment : iTermText - -@property (copy) NSString *fileName; // The path to the file for the attachment - - -@end - -// This subdivides the text into words. -@interface iTermWord : iTermItem - -- (SBElementArray *) attachments; -- (SBElementArray *) attributeRuns; -- (SBElementArray *) characters; -- (SBElementArray *) paragraphs; -- (SBElementArray *) words; - -@property (copy) NSColor *color; // The color of the first character. -@property (copy) NSString *font; // The name of the font of the first character. -@property NSInteger size; // The size in points of the first character. - - -@end - - - -/* - * iTerm Suite - */ - -// Main application class -@interface iTermITermApplication (ITermSuite) - -- (SBElementArray *) terminals; - -@property (copy) iTermTerminal *currentTerminal; // currently active terminal - -@end - -// A terminal session -@interface iTermSession : iTermItem - -@property (copy) NSColor *backgroundColor; // Background color -@property (copy) NSString *backgroundImagePath; // Path to background image -@property (copy) NSColor *boldColor; // Bold color -@property (copy, readonly) NSString *contents; // text of the session -@property (copy) NSColor *cursorColor; // Cursor color -@property (copy) NSColor *cursor_textColor; // Cursor text color -@property (copy) NSColor *foregroundColor; // Foreground color -- (NSString *) id; // id of session; set to tty name -@property (copy) NSString *name; // Name of this session -@property NSInteger number; // index of session -@property (copy) NSColor *selectedTextColor; // Selected text color -@property (copy) NSColor *selectionColor; // Selection color -@property double transparency; // Transparency (0-1) -@property (copy, readonly) NSString *tty; // tty device of session - - -@end - -// A pseudo terminal -@interface iTermTerminal : iTermItem - -- (SBElementArray *) sessions; - -@property BOOL antiAlias; // Anti alias for window -@property (copy) iTermSession *currentSession; // current session in the terminal -@property NSInteger numberOfColumns; // Number of columns -@property NSInteger numberOfRows; // Number of rows - - -@end - - - -/* - * Type Definitions - */ - -@interface iTermPrintSettings : SBObject - -@property NSInteger copies; // the number of copies of a document to be printed -@property BOOL collating; // Should printed copies be collated? -@property NSInteger startingPage; // the first page of the document to be printed -@property NSInteger endingPage; // the last page of the document to be printed -@property NSInteger pagesAcross; // number of logical pages laid across a physical page -@property NSInteger pagesDown; // number of logical pages laid out down a physical page -@property (copy) NSDate *requestedPrintTime; // the time at which the desktop printer should print the document -@property iTermEnum errorHandling; // how errors are handled -@property (copy) NSString *faxNumber; // for fax number -@property (copy) NSString *targetPrinter; // for target printer - -- (void) closeSaving:(iTermSavo)saving savingIn:(NSURL *)savingIn; // Close an object. -- (void) delete; // Delete an object. -- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. -- (BOOL) exists; // Verify if an object exists. -- (void) moveTo:(SBObject *)to; // Move object(s) to a new location. -- (void) saveAs:(NSString *)as in:(NSURL *)in_; // Save an object. -- (void) execCommand:(NSString *)command; // Executes a command in a session (attach a trailing space for commands without carriage return) -- (void) launchSession:(NSString *)session; // Launches a default or saved session -- (void) select; // Selects a specified session -- (void) terminate; // Terminates a session -- (void) writeContentsOfFile:(NSString *)contentsOfFile text:(NSString *)text; // Writes text or file contents into a session - -@end - diff --git a/ScriptingBridge/iTerm2.h b/ScriptingBridge/iTerm2.h index 4115745..aca9708 100644 --- a/ScriptingBridge/iTerm2.h +++ b/ScriptingBridge/iTerm2.h @@ -21,16 +21,7 @@ enum iTerm2Enum { }; typedef enum iTerm2Enum iTerm2Enum; - - -/* - * Standard Suite - */ - -// A scriptable object. -@interface iTerm2Item : SBObject - -@property (copy) NSDictionary *properties; // All of the object's properties. +@protocol iTerm2GenericMethods - (void) closeSaving:(iTerm2Savo)saving savingIn:(NSURL *)savingIn; // Close an object. - (void) delete; // Delete an object. @@ -46,11 +37,25 @@ typedef enum iTerm2Enum iTerm2Enum; @end + + +/* + * Standard Suite + */ + +// A scriptable object. +@interface iTerm2Item : SBObject + +@property (copy) NSDictionary *properties; // All of the object's properties. + + +@end + // An application's top level scripting object. @interface iTerm2ITermApplication : SBApplication -- (SBElementArray *) documents; -- (SBElementArray *) windows; +- (SBElementArray *) documents; +- (SBElementArray *) windows; @property (readonly) BOOL frontmost; // Is this the frontmost (active) application? @property (copy, readonly) NSString *name; // The name of the application. @@ -109,11 +114,11 @@ typedef enum iTerm2Enum iTerm2Enum; // This subdivides the text into chunks that all have the same attributes. @interface iTerm2AttributeRun : iTerm2Item -- (SBElementArray *) attachments; -- (SBElementArray *) attributeRuns; -- (SBElementArray *) characters; -- (SBElementArray *) paragraphs; -- (SBElementArray *) words; +- (SBElementArray *) attachments; +- (SBElementArray *) attributeRuns; +- (SBElementArray *) characters; +- (SBElementArray *) paragraphs; +- (SBElementArray *) words; @property (copy) NSColor *color; // The color of the first character. @property (copy) NSString *font; // The name of the font of the first character. @@ -125,11 +130,11 @@ typedef enum iTerm2Enum iTerm2Enum; // This subdivides the text into characters. @interface iTerm2Character : iTerm2Item -- (SBElementArray *) attachments; -- (SBElementArray *) attributeRuns; -- (SBElementArray *) characters; -- (SBElementArray *) paragraphs; -- (SBElementArray *) words; +- (SBElementArray *) attachments; +- (SBElementArray *) attributeRuns; +- (SBElementArray *) characters; +- (SBElementArray *) paragraphs; +- (SBElementArray *) words; @property (copy) NSColor *color; // The color of the first character. @property (copy) NSString *font; // The name of the font of the first character. @@ -141,11 +146,11 @@ typedef enum iTerm2Enum iTerm2Enum; // This subdivides the text into paragraphs. @interface iTerm2Paragraph : iTerm2Item -- (SBElementArray *) attachments; -- (SBElementArray *) attributeRuns; -- (SBElementArray *) characters; -- (SBElementArray *) paragraphs; -- (SBElementArray *) words; +- (SBElementArray *) attachments; +- (SBElementArray *) attributeRuns; +- (SBElementArray *) characters; +- (SBElementArray *) paragraphs; +- (SBElementArray *) words; @property (copy) NSColor *color; // The color of the first character. @property (copy) NSString *font; // The name of the font of the first character. @@ -157,11 +162,11 @@ typedef enum iTerm2Enum iTerm2Enum; // Rich (styled) text @interface iTerm2Text : iTerm2Item -- (SBElementArray *) attachments; -- (SBElementArray *) attributeRuns; -- (SBElementArray *) characters; -- (SBElementArray *) paragraphs; -- (SBElementArray *) words; +- (SBElementArray *) attachments; +- (SBElementArray *) attributeRuns; +- (SBElementArray *) characters; +- (SBElementArray *) paragraphs; +- (SBElementArray *) words; @property (copy) NSColor *color; // The color of the first character. @property (copy) NSString *font; // The name of the font of the first character. @@ -181,11 +186,11 @@ typedef enum iTerm2Enum iTerm2Enum; // This subdivides the text into words. @interface iTerm2Word : iTerm2Item -- (SBElementArray *) attachments; -- (SBElementArray *) attributeRuns; -- (SBElementArray *) characters; -- (SBElementArray *) paragraphs; -- (SBElementArray *) words; +- (SBElementArray *) attachments; +- (SBElementArray *) attributeRuns; +- (SBElementArray *) characters; +- (SBElementArray *) paragraphs; +- (SBElementArray *) words; @property (copy) NSColor *color; // The color of the first character. @property (copy) NSString *font; // The name of the font of the first character. @@ -203,9 +208,10 @@ typedef enum iTerm2Enum iTerm2Enum; // Main application class @interface iTerm2ITermApplication (ITermSuite) -- (SBElementArray *) terminals; +- (SBElementArray *) terminals; @property (copy) iTerm2Terminal *currentTerminal; // currently active terminal +@property (copy) NSString *uriToken; // URI token @end @@ -233,7 +239,7 @@ typedef enum iTerm2Enum iTerm2Enum; // A pseudo terminal @interface iTerm2Terminal : iTerm2Item -- (SBElementArray *) sessions; +- (SBElementArray *) sessions; @property BOOL antiAlias; // Anti alias for window @property (copy) iTerm2Session *currentSession; // current session in the terminal @@ -249,7 +255,7 @@ typedef enum iTerm2Enum iTerm2Enum; * Type Definitions */ -@interface iTerm2PrintSettings : SBObject +@interface iTerm2PrintSettings : SBObject @property NSInteger copies; // the number of copies of a document to be printed @property BOOL collating; // Should printed copies be collated? @@ -262,17 +268,6 @@ typedef enum iTerm2Enum iTerm2Enum; @property (copy) NSString *faxNumber; // for fax number @property (copy) NSString *targetPrinter; // for target printer -- (void) closeSaving:(iTerm2Savo)saving savingIn:(NSURL *)savingIn; // Close an object. -- (void) delete; // Delete an object. -- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. -- (BOOL) exists; // Verify if an object exists. -- (void) moveTo:(SBObject *)to; // Move object(s) to a new location. -- (void) saveAs:(NSString *)as in:(NSURL *)in_; // Save an object. -- (void) execCommand:(NSString *)command; // Executes a command in a session (attach a trailing space for commands without carriage return) -- (iTerm2Session *) launchSession:(NSString *)session; // Launches a default or saved session -- (void) select; // Selects a specified session -- (void) terminate; // Terminates a session -- (void) writeContentsOfFile:(NSString *)contentsOfFile text:(NSString *)text; // Writes text or file contents into a session @end diff --git a/ScriptingBridge/iTerm2Nightly.h b/ScriptingBridge/iTerm2Nightly.h index 0bdfd59..b67ce87 100644 --- a/ScriptingBridge/iTerm2Nightly.h +++ b/ScriptingBridge/iTerm2Nightly.h @@ -15,6 +15,28 @@ enum iTerm2NightlySaveOptions { }; typedef enum iTerm2NightlySaveOptions iTerm2NightlySaveOptions; +@protocol iTerm2NightlyGenericMethods + +- (void) delete; // Delete an object. +- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. +- (BOOL) exists; // Verify if an object exists. +- (void) moveTo:(SBObject *)to; // Move object(s) to a new location. +- (void) close; // Close a document. +- (iTerm2NightlyTab *) createTabWithProfile:(NSString *)withProfile command:(NSString *)command; // Create a new tab +- (iTerm2NightlyTab *) createTabWithDefaultProfileCommand:(NSString *)command; // Create a new tab with the default profile +- (void) writeContentsOfFile:(NSURL *)contentsOfFile text:(NSString *)text newline:(BOOL)newline; // Send text as though it was typed. +- (void) select; // Make receiver visible and selected. +- (iTerm2NightlySession *) splitVerticallyWithProfile:(NSString *)withProfile command:(NSString *)command; // Split a session vertically. +- (iTerm2NightlySession *) splitVerticallyWithDefaultProfileCommand:(NSString *)command; // Split a session vertically, using the default profile for the new session +- (iTerm2NightlySession *) splitVerticallyWithSameProfileCommand:(NSString *)command; // Split a session vertically, using the original session's profile for the new session +- (iTerm2NightlySession *) splitHorizontallyWithProfile:(NSString *)withProfile command:(NSString *)command; // Split a session horizontally. +- (iTerm2NightlySession *) splitHorizontallyWithDefaultProfileCommand:(NSString *)command; // Split a session horizontally, using the default profile for the new session +- (iTerm2NightlySession *) splitHorizontallyWithSameProfileCommand:(NSString *)command; // Split a session horizontally, using the original session's profile for the new session +- (NSString *) variableNamed:(NSString *)named; // Returns the value of a session variable with the given name +- (NSString *) setVariableNamed:(NSString *)named to:(NSString *)to; // Sets the value of a session variable + +@end + /* @@ -24,24 +46,24 @@ typedef enum iTerm2NightlySaveOptions iTerm2NightlySaveOptions; // The application's top-level scripting object. @interface iTerm2NightlyApplication : SBApplication -- (SBElementArray *) windows; +- (SBElementArray *) windows; @property (copy) iTerm2NightlyWindow *currentWindow; // The frontmost window @property (copy, readonly) NSString *name; // The name of the application. @property (readonly) BOOL frontmost; // Is this the frontmost (active) application? @property (copy, readonly) NSString *version; // The version of the application. -- (void) quitSaving:(iTerm2NightlySaveOptions)saving; // Quit the application. - (iTerm2NightlyWindow *) createWindowWithProfile:(NSString *)x command:(NSString *)command; // Create a new window - (iTerm2NightlyWindow *) createWindowWithDefaultProfileCommand:(NSString *)command; // Create a new window with the default profile @end // A window. -@interface iTerm2NightlyWindow : SBObject +@interface iTerm2NightlyWindow : SBObject -- (SBElementArray *) tabs; +- (SBElementArray *) tabs; +- (NSString *) id; // The unique identifier of the session. @property (copy, readonly) NSString *name; // The full title of the window. @property NSInteger index; // The index of the window, ordered front to back. @property NSRect bounds; // The bounding rectangle of the window. @@ -60,21 +82,6 @@ typedef enum iTerm2NightlySaveOptions iTerm2NightlySaveOptions; @property NSPoint size; // The width and height of the window @property NSRect frame; // The bounding rectangle, relative to the lower left corner of the screen. -- (void) delete; // Delete an object. -- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. -- (BOOL) exists; // Verify if an object exists. -- (void) moveTo:(SBObject *)to; // Move object(s) to a new location. -- (void) close; // Close a document. -- (iTerm2NightlyTab *) createTabWithProfile:(NSString *)withProfile command:(NSString *)command; // Create a new tab -- (iTerm2NightlyTab *) createTabWithDefaultProfileCommand:(NSString *)command; // Create a new tab with the default profile -- (void) writeContentsOfFile:(NSURL *)contentsOfFile text:(NSString *)text newline:(BOOL)newline; // Send text as though it was typed. -- (void) select; // Make receiver visible and selected. -- (iTerm2NightlySession *) splitVerticallyWithProfile:(NSString *)withProfile; // Split a session vertically. -- (iTerm2NightlySession *) splitVerticallyWithDefaultProfile; // Split a session vertically, using the default profile for the new session -- (iTerm2NightlySession *) splitVerticallyWithSameProfile; // Split a session vertically, using the original session's profile for the new session -- (iTerm2NightlySession *) splitHorizontallyWithProfile:(NSString *)withProfile; // Split a session horizontally. -- (iTerm2NightlySession *) splitHorizontallyWithDefaultProfile; // Split a session horizontally, using the default profile for the new session -- (iTerm2NightlySession *) splitHorizontallyWithSameProfile; // Split a session horizontally, using the original session's profile for the new session @end @@ -85,34 +92,20 @@ typedef enum iTerm2NightlySaveOptions iTerm2NightlySaveOptions; */ // A terminal tab -@interface iTerm2NightlyTab : SBObject +@interface iTerm2NightlyTab : SBObject -- (SBElementArray *) sessions; +- (SBElementArray *) sessions; @property (copy) iTerm2NightlySession *currentSession; // The current session in a tab @property NSInteger index; // Index of tab in parent tab view control -- (void) delete; // Delete an object. -- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. -- (BOOL) exists; // Verify if an object exists. -- (void) moveTo:(SBObject *)to; // Move object(s) to a new location. -- (void) close; // Close a document. -- (iTerm2NightlyTab *) createTabWithProfile:(NSString *)withProfile command:(NSString *)command; // Create a new tab -- (iTerm2NightlyTab *) createTabWithDefaultProfileCommand:(NSString *)command; // Create a new tab with the default profile -- (void) writeContentsOfFile:(NSURL *)contentsOfFile text:(NSString *)text newline:(BOOL)newline; // Send text as though it was typed. -- (void) select; // Make receiver visible and selected. -- (iTerm2NightlySession *) splitVerticallyWithProfile:(NSString *)withProfile; // Split a session vertically. -- (iTerm2NightlySession *) splitVerticallyWithDefaultProfile; // Split a session vertically, using the default profile for the new session -- (iTerm2NightlySession *) splitVerticallyWithSameProfile; // Split a session vertically, using the original session's profile for the new session -- (iTerm2NightlySession *) splitHorizontallyWithProfile:(NSString *)withProfile; // Split a session horizontally. -- (iTerm2NightlySession *) splitHorizontallyWithDefaultProfile; // Split a session horizontally, using the default profile for the new session -- (iTerm2NightlySession *) splitHorizontallyWithSameProfile; // Split a session horizontally, using the original session's profile for the new session @end // A terminal session -@interface iTerm2NightlySession : SBObject +@interface iTerm2NightlySession : SBObject +- (NSString *) id; // The unique identifier of the session. @property BOOL isProcessing; // The session has received output recently. @property BOOL isAtShellPrompt; // The terminal is at the shell prompt. Requires shell integration. @property NSInteger columns; @@ -146,22 +139,9 @@ typedef enum iTerm2NightlySaveOptions iTerm2NightlySaveOptions; @property (copy) NSString *name; @property double transparency; @property (copy, readonly) NSString *uniqueID; +@property (copy, readonly) NSString *profileName; // The session's profile name +@property (copy) NSString *answerbackString; // ENQ Answerback string -- (void) delete; // Delete an object. -- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. -- (BOOL) exists; // Verify if an object exists. -- (void) moveTo:(SBObject *)to; // Move object(s) to a new location. -- (void) close; // Close a document. -- (iTerm2NightlyTab *) createTabWithProfile:(NSString *)withProfile command:(NSString *)command; // Create a new tab -- (iTerm2NightlyTab *) createTabWithDefaultProfileCommand:(NSString *)command; // Create a new tab with the default profile -- (void) writeContentsOfFile:(NSURL *)contentsOfFile text:(NSString *)text newline:(BOOL)newline; // Send text as though it was typed. -- (void) select; // Make receiver visible and selected. -- (iTerm2NightlySession *) splitVerticallyWithProfile:(NSString *)withProfile; // Split a session vertically. -- (iTerm2NightlySession *) splitVerticallyWithDefaultProfile; // Split a session vertically, using the default profile for the new session -- (iTerm2NightlySession *) splitVerticallyWithSameProfile; // Split a session vertically, using the original session's profile for the new session -- (iTerm2NightlySession *) splitHorizontallyWithProfile:(NSString *)withProfile; // Split a session horizontally. -- (iTerm2NightlySession *) splitHorizontallyWithDefaultProfile; // Split a session horizontally, using the default profile for the new session -- (iTerm2NightlySession *) splitHorizontallyWithSameProfile; // Split a session horizontally, using the original session's profile for the new session @end diff --git a/Term Window/DTTermWindowController.m b/Term Window/DTTermWindowController.m index 5d81db8..507953e 100644 --- a/Term Window/DTTermWindowController.m +++ b/Term Window/DTTermWindowController.m @@ -9,7 +9,6 @@ #import "DTResultsTextView.h" #import "DTRunManager.h" #import "DTShellUtilities.h" -#import "iTerm.h" #import "iTerm2.h" #import "iTerm2Nightly.h" #import "Terminal.h" @@ -233,7 +232,7 @@ - (IBAction)executeCommandInTerminal:(id) __unused sender { iTerm = [SBApplication applicationWithBundleIdentifier:@"com.googlecode.iterm2"]; // test for iTerms newer scripting bridge - if(iTerm && [iTerm respondsToSelector:@selector(quitSaving:)]) { + if(iTerm && [iTerm respondsToSelector:@selector(createWindowWithDefaultProfileCommand:)]) { iTerm2NightlyWindow *terminal = nil; iTerm2NightlySession *session = nil; @@ -252,9 +251,9 @@ - (IBAction)executeCommandInTerminal:(id) __unused sender { } [iTerm activate]; - } else if(iTerm) { // assume old scripting bridge - iTermTerminal *terminal = nil; - iTermSession *session = nil; + } else if(iTerm && [iTerm respondsToSelector:@selector(isRunning)]) { // assume old scripting bridge + iTerm2Terminal *terminal = nil; + iTerm2Session *session = nil; if([iTerm isRunning]) { // set terminal to (make new terminal at the end of terminals)