Permalink
Browse files

* Added Applescript support to select session by name:

      select session named "aName"
  • Loading branch information...
1 parent f803dbc commit 8087c055bcef0daee7a5782b47d98d6b74ac0834 Ujwal S. Setlur committed Apr 29, 2003
Showing with 27 additions and 2 deletions.
  1. +3 −0 Changelog
  2. +2 −1 PseudoTerminal.h
  3. +22 −1 PseudoTerminal.m
View
@@ -10,6 +10,9 @@
and "write contents of file <file>" to a session.
* A little more code consolidation in PseudoTerminal.
+
+ * Added Applescript support to select session by name:
+ select session named "aName"
2003-04-28 fabian
* Dynamically change the tab size based on the number of tabs
View
@@ -1,5 +1,5 @@
// -*- mode:objc -*-
-// $Id: PseudoTerminal.h,v 1.48 2003-04-29 00:24:07 ujwal Exp $
+// $Id: PseudoTerminal.h,v 1.49 2003-04-29 22:54:37 ujwal Exp $
/*
** PseudoTerminal.h
**
@@ -205,6 +205,7 @@
// accessors for to-many relationships:
// (See NSScriptKeyValueCoding.h)
-(id)valueInSessionsAtIndex:(unsigned)index;
+-(id)valueWithName: (NSString *)uniqueName inPropertyWithKey: (NSString*)propertyKey;
-(void)replaceInSessions:(PTYSession *)object atIndex:(unsigned)index;
-(void)addInSessions:(PTYSession *)object;
-(void)insertInSessions:(PTYSession *)object;
View
@@ -1,5 +1,5 @@
// -*- mode:objc -*-
-// $Id: PseudoTerminal.m,v 1.165 2003-04-29 17:11:04 yfabian Exp $
+// $Id: PseudoTerminal.m,v 1.166 2003-04-29 22:54:31 ujwal Exp $
//
/*
** PseudoTerminal.m
@@ -1726,6 +1726,27 @@ -(id)valueInSessionsAtIndex:(unsigned)index
return ([ptyList objectAtIndex: index]);
}
+-(id)valueWithName: (NSString *)uniqueName inPropertyWithKey: (NSString*)propertyKey
+{
+ id result = nil;
+ int i;
+
+ if([propertyKey isEqualToString: sessionsKey] == YES)
+ {
+ PTYSession *aSession;
+
+ for (i= 0; i < [ptyList count]; i++)
+ {
+ aSession = [ptyList objectAtIndex: i];
+ if([[aSession name] isEqualToString: uniqueName] == YES)
+ return (aSession);
+ }
+ }
+
+ return result;
+}
+
+
-(void)replaceInSessions:(PTYSession *)object atIndex:(unsigned)index
{
// NSLog(@"PseudoTerminal: -replaceInSessions: 0x%x atIndex: %d", object, index);

0 comments on commit 8087c05

Please sign in to comment.