Skip to content

合并官方更新 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 26 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,16 @@ Possible values are ```Terminal.app``` or ```iTerm```
#### ```"iTerm_version": "VALUE",```
_This changes the applescripts for iTerm (Global Setting)_

Possible values are ```stable``` or ```nightly```
Possible values are ```legacy``` or ```stable``` or ```nightly```

**If ```terminal``` is set to ```iTerm``` this setting is mandatory**

```"iTerm_version": "legacy",``` targeting iTerm 2.14

```"iTerm_version": "stable",``` targeting new versions of iTerm

```"iTerm_version": "nightly",```targeting only the nightly build of iTerm

_This setting is ignored if your terminal is set to ```Terminal.app```_

----
Expand Down Expand Up @@ -207,23 +213,30 @@ If ```title``` is missing shuttle uses the menu's name and sets this as ```title

## Contributors

This project was created by Trevor Fitzgerald. I owe many thanks to the following people who have helped make Shuttle even better.
This project was created by [Trevor Fitzgerald](https://github.com/fitztrev). I owe many thanks to the following people who have helped make Shuttle even better.

(In alphabetical order)

* Alex Carter
* Dave Eddy
* Dmitry Filimonov
* Frank Enderle
* Jack Weeden
* Justin Swanson
* [Alex Carter](https://github.com/blazeworx)
* [Dave Eddy](https://github.com/bahamas10)
* [Dmitry Filimonov](https://github.com/petethepig)
* [Frank Enderle](https://github.com/fenderle)
* [Jack Weeden](https://github.com/jackbot)
* [Justin Swanson](https://github.com/geeksunny)
* [Kees Fransen](https://github.com/keesfransen)
* Marco Aurélio
* Martin Grund
* Michael Davis
* Rui Rodrigues
* Ryan Cohen
* [Martin Grund](https://github.com/grundprinzip)
* [Matt Turner](https://github.com/thshdw)
* [Michael Davis](https://github.com/mpdavis)
* [Morton Fox](https://github.com/mortonfox)
* [pluwen](https://github.com/pluwen)
* [Rui Rodrigues](https://github.com/rmrodrigues)
* [Ryan Cohen](https://github.com/imryan)
* [Stefan Jansen](https://github.com/steffex)
* Thomas Rosenstein
* Tibor Bödecs
* [Thoro](https://github.com/Thoro)
* [Tibor Bödecs](https://github.com/tib)
* [welsonla](https://github.com/welsonla)

## Credits

Expand Down
36 changes: 24 additions & 12 deletions Shuttle.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
0ADB3B0F178EF8DB004E9BB9 /* StatusIconAlt@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0ADB3B0B178EF8DB004E9BB9 /* StatusIconAlt@2x.png */; };
0ADB3B13178F3DE4004E9BB9 /* LaunchAtLoginController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0ADB3B12178F3DE4004E9BB9 /* LaunchAtLoginController.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
7E74A7C61789CE2F0079E0D2 /* shuttle.default.json in Resources */ = {isa = PBXBuildFile; fileRef = 7E74A7C51789CE2F0079E0D2 /* shuttle.default.json */; };
A12D9BF01BCF2C73004F52A6 /* iTerm-stable-current-window.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A12D9BE71BCF2C72004F52A6 /* iTerm-stable-current-window.scpt */; };
A12D9BF11BCF2C73004F52A6 /* iTerm-stable-new-tab-default.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A12D9BE81BCF2C72004F52A6 /* iTerm-stable-new-tab-default.scpt */; };
A12D9BF21BCF2C73004F52A6 /* iTerm-stable-new-window.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A12D9BE91BCF2C72004F52A6 /* iTerm-stable-new-window.scpt */; };
A124BA191D45572B00218F2F /* iTerm2-stable-current-window.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A124BA161D45572B00218F2F /* iTerm2-stable-current-window.scpt */; };
A124BA1A1D45572B00218F2F /* iTerm2-stable-new-tab-default.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A124BA171D45572B00218F2F /* iTerm2-stable-new-tab-default.scpt */; };
A124BA1B1D45572B00218F2F /* iTerm2-stable-new-window.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A124BA181D45572B00218F2F /* iTerm2-stable-new-window.scpt */; };
A124BA1F1D4558E500218F2F /* iTerm-legacy-current-window.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A124BA1C1D4558E500218F2F /* iTerm-legacy-current-window.scpt */; };
A124BA201D4558E500218F2F /* iTerm-legacy-new-tab-default.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A124BA1D1D4558E500218F2F /* iTerm-legacy-new-tab-default.scpt */; };
A124BA211D4558E500218F2F /* iTerm-legacy-new-window.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A124BA1E1D4558E500218F2F /* iTerm-legacy-new-window.scpt */; };
A12D9BF31BCF2C73004F52A6 /* iTerm2-nightly-current-window.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A12D9BEA1BCF2C73004F52A6 /* iTerm2-nightly-current-window.scpt */; };
A12D9BF41BCF2C73004F52A6 /* iTerm2-nightly-new-tab-default.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A12D9BEB1BCF2C73004F52A6 /* iTerm2-nightly-new-tab-default.scpt */; };
A12D9BF51BCF2C73004F52A6 /* iTerm2-nightly-new-window.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A12D9BEC1BCF2C73004F52A6 /* iTerm2-nightly-new-window.scpt */; };
Expand All @@ -42,9 +45,12 @@
0ADB3B12178F3DE4004E9BB9 /* LaunchAtLoginController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LaunchAtLoginController.m; sourceTree = "<group>"; };
7E72D21E178003ED00A6389C /* Shuttle.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Shuttle.entitlements; sourceTree = "<group>"; };
7E74A7C51789CE2F0079E0D2 /* shuttle.default.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = shuttle.default.json; sourceTree = "<group>"; };
A12D9BE71BCF2C72004F52A6 /* iTerm-stable-current-window.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm-stable-current-window.scpt"; sourceTree = "<group>"; };
A12D9BE81BCF2C72004F52A6 /* iTerm-stable-new-tab-default.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm-stable-new-tab-default.scpt"; sourceTree = "<group>"; };
A12D9BE91BCF2C72004F52A6 /* iTerm-stable-new-window.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm-stable-new-window.scpt"; sourceTree = "<group>"; };
A124BA161D45572B00218F2F /* iTerm2-stable-current-window.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm2-stable-current-window.scpt"; sourceTree = "<group>"; };
A124BA171D45572B00218F2F /* iTerm2-stable-new-tab-default.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm2-stable-new-tab-default.scpt"; sourceTree = "<group>"; };
A124BA181D45572B00218F2F /* iTerm2-stable-new-window.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm2-stable-new-window.scpt"; sourceTree = "<group>"; };
A124BA1C1D4558E500218F2F /* iTerm-legacy-current-window.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm-legacy-current-window.scpt"; sourceTree = "<group>"; };
A124BA1D1D4558E500218F2F /* iTerm-legacy-new-tab-default.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm-legacy-new-tab-default.scpt"; sourceTree = "<group>"; };
A124BA1E1D4558E500218F2F /* iTerm-legacy-new-window.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm-legacy-new-window.scpt"; sourceTree = "<group>"; };
A12D9BEA1BCF2C73004F52A6 /* iTerm2-nightly-current-window.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm2-nightly-current-window.scpt"; sourceTree = "<group>"; };
A12D9BEB1BCF2C73004F52A6 /* iTerm2-nightly-new-tab-default.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm2-nightly-new-tab-default.scpt"; sourceTree = "<group>"; };
A12D9BEC1BCF2C73004F52A6 /* iTerm2-nightly-new-window.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm2-nightly-new-window.scpt"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -96,9 +102,12 @@
A12D9BE61BCF2C72004F52A6 /* apple-scpt */ = {
isa = PBXGroup;
children = (
A12D9BE71BCF2C72004F52A6 /* iTerm-stable-current-window.scpt */,
A12D9BE81BCF2C72004F52A6 /* iTerm-stable-new-tab-default.scpt */,
A12D9BE91BCF2C72004F52A6 /* iTerm-stable-new-window.scpt */,
A124BA1C1D4558E500218F2F /* iTerm-legacy-current-window.scpt */,
A124BA1D1D4558E500218F2F /* iTerm-legacy-new-tab-default.scpt */,
A124BA1E1D4558E500218F2F /* iTerm-legacy-new-window.scpt */,
A124BA161D45572B00218F2F /* iTerm2-stable-current-window.scpt */,
A124BA171D45572B00218F2F /* iTerm2-stable-new-tab-default.scpt */,
A124BA181D45572B00218F2F /* iTerm2-stable-new-window.scpt */,
A12D9BEA1BCF2C73004F52A6 /* iTerm2-nightly-current-window.scpt */,
A12D9BEB1BCF2C73004F52A6 /* iTerm2-nightly-new-tab-default.scpt */,
A12D9BEC1BCF2C73004F52A6 /* iTerm2-nightly-new-window.scpt */,
Expand Down Expand Up @@ -232,22 +241,25 @@
A12D9BF61BCF2C73004F52A6 /* terminal-current-window.scpt in Resources */,
A12D9BF31BCF2C73004F52A6 /* iTerm2-nightly-current-window.scpt in Resources */,
A12D9BF51BCF2C73004F52A6 /* iTerm2-nightly-new-window.scpt in Resources */,
A12D9BF21BCF2C73004F52A6 /* iTerm-stable-new-window.scpt in Resources */,
0ADB3B0D178EF8DB004E9BB9 /* StatusIcon.png in Resources */,
A12D9BF11BCF2C73004F52A6 /* iTerm-stable-new-tab-default.scpt in Resources */,
A124BA1F1D4558E500218F2F /* iTerm-legacy-current-window.scpt in Resources */,
0ADB3B0C178EF8DB004E9BB9 /* StatusIconAlt.png in Resources */,
C149EC0815D5214600B1F558 /* InfoPlist.strings in Resources */,
A1D700091A5DCFE1003563E4 /* AboutWindowController.xib in Resources */,
0ADB3B0F178EF8DB004E9BB9 /* StatusIconAlt@2x.png in Resources */,
0ADB3B0E178EF8DB004E9BB9 /* StatusIcon@2x.png in Resources */,
A124BA191D45572B00218F2F /* iTerm2-stable-current-window.scpt in Resources */,
A12D9BF41BCF2C73004F52A6 /* iTerm2-nightly-new-tab-default.scpt in Resources */,
C149EC0E15D5214600B1F558 /* Credits.rtf in Resources */,
A12D9BF01BCF2C73004F52A6 /* iTerm-stable-current-window.scpt in Resources */,
A12D9BF71BCF2C73004F52A6 /* terminal-new-tab-default.scpt in Resources */,
C149EC1415D5214600B1F558 /* MainMenu.xib in Resources */,
A124BA1B1D45572B00218F2F /* iTerm2-stable-new-window.scpt in Resources */,
A124BA1A1D45572B00218F2F /* iTerm2-stable-new-tab-default.scpt in Resources */,
C159DC2815D5DE8000F5DE24 /* shuttle.icns in Resources */,
A12D9BF81BCF2C73004F52A6 /* terminal-new-window.scpt in Resources */,
7E74A7C61789CE2F0079E0D2 /* shuttle.default.json in Resources */,
A124BA201D4558E500218F2F /* iTerm-legacy-new-tab-default.scpt in Resources */,
A124BA211D4558E500218F2F /* iTerm-legacy-new-window.scpt in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
44 changes: 33 additions & 11 deletions Shuttle/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ - (void) buildMenu:(NSArray*)data addToMenu:(NSMenu *)m {
NSString *menuName = cfg[@"name"];

//Place the terminal command, theme, and title into an comma delimited string
NSString *menuRepObj = [NSString stringWithFormat:@"%@,%@,%@,%@,%@", menuCmd, termTheme, termTitle, termWindow, menuName];
NSString *menuRepObj = [NSString stringWithFormat:@"%@¬_¬%@¬_¬%@¬_¬%@¬_¬%@", menuCmd, termTheme, termTitle, termWindow, menuName];

[menuItem setTitle:cfg[@"name"]];
[menuItem setRepresentedObject:menuRepObj];
Expand All @@ -383,7 +383,7 @@ - (void) openHost:(NSMenuItem *) sender {


//Place the comma delimited string of menu item settings into an array
NSArray *objectsFromJSON = [[sender representedObject] componentsSeparatedByString:(@",")];
NSArray *objectsFromJSON = [[sender representedObject] componentsSeparatedByString:(@"¬_¬")];

//This is our command that will be run in the terminal window
NSString *escapedObject;
Expand Down Expand Up @@ -443,10 +443,15 @@ - (void) openHost:(NSMenuItem *) sender {
}
}

//Set Paths to iTerm Legacy AppleScripts
NSString *iTermLegacyNewWindow = [[NSBundle mainBundle] pathForResource:@"iTerm-legacy-new-window" ofType:@"scpt"];
NSString *iTermLegacyCurrentWindow = [[NSBundle mainBundle] pathForResource:@"iTerm-legacy-current-window" ofType:@"scpt"];
NSString *iTermLegacyNewTabDefault = [[NSBundle mainBundle] pathForResource:@"iTerm-legacy-new-tab-default" ofType:@"scpt"];

//Set Paths to iTerm Stable AppleScripts
NSString *iTermStableNewWindow = [[NSBundle mainBundle] pathForResource:@"iTerm-stable-new-window" ofType:@"scpt"];
NSString *iTermStableCurrentWindow = [[NSBundle mainBundle] pathForResource:@"iTerm-stable-current-window" ofType:@"scpt"];
NSString *iTermStableNewTabDefault = [[NSBundle mainBundle] pathForResource:@"iTerm-stable-new-tab-default" ofType:@"scpt"];
NSString *iTermStableNewWindow = [[NSBundle mainBundle] pathForResource:@"iTerm2-stable-new-window" ofType:@"scpt"];
NSString *iTermStableCurrentWindow = [[NSBundle mainBundle] pathForResource:@"iTerm2-stable-current-window" ofType:@"scpt"];
NSString *iTermStableNewTabDefault = [[NSBundle mainBundle] pathForResource:@"iTerm2-stable-new-tab-default" ofType:@"scpt"];

//Set Paths to iTerm Nightly AppleScripts
NSString *iTerm2NightlyNewWindow = [[NSBundle mainBundle] pathForResource:@"iTerm2-nightly-new-window" ofType:@"scpt"];
Expand Down Expand Up @@ -474,11 +479,11 @@ - (void) openHost:(NSMenuItem *) sender {
else if ( [terminalPref rangeOfString: @"iterm"].location !=NSNotFound ) {

//If the JSON prefs for iTermVersion are not stable or nightly throw an error
if( ![iTermVersionPref isEqualToString: @"stable"] && ![iTermVersionPref isEqualToString:@"nightly"] ) {
if( ![iTermVersionPref isEqualToString: @"legacy"] && ![iTermVersionPref isEqualToString: @"stable"] && ![iTermVersionPref isEqualToString:@"nightly"] ) {

if( iTermVersionPref == 0 ) {
errorMessage = @"\"iTerm_version\": \"VALUE\", is missing.\n\"VALUE\" can be \"stable\" or \"nightly\"\n\nPlease fix your shuttle JSON settings.\nSee readme.md on shuttle's github for help.";
errorInfo = @"Press Continue to try iTerm stable applescripts.\n -->(not recommended)<--\nThis will fail if you have iTerm nightly installed.\n\nPlease fix the JSON settings.\nPress Quit to exit shuttle.";
errorMessage = @"\"iTerm_version\": \"VALUE\", is missing.\n\n\"VALUE\" can be:\n\"legacy\" targeting iTerm 2.14\n\"stable\" targeting new versions.\n\"nightly\" targeting nightly builds.\n\nPlease fix your shuttle JSON settings.\nSee readme.md on shuttle's github for help.";
errorInfo = @"Press Continue to try iTerm stable applescripts.\n -->(not recommended)<--\nThis will fail if you have another version of iTerm installed.\n\nPlease fix the JSON settings.\nPress Quit to exit shuttle.";
[self throwError:errorMessage additionalInfo:errorInfo continueOnErrorOption:YES];
iTermVersionPref = @"stable";

Expand All @@ -489,9 +494,26 @@ - (void) openHost:(NSMenuItem *) sender {
}
}

if( [iTermVersionPref isEqualToString:@"stable"]) {
if( [iTermVersionPref isEqualToString:@"legacy"]) {

//run the applescript that works with iTerm Stable
//run the applescript that works with iTerm Legacy
//if we are running in a new iTerm "Stable" Window
if ( [terminalWindow isEqualToString:@"new"] ) {
[self runScript:iTermLegacyNewWindow handler:handlerName parameters:passParameters];
}
//if we are running in the current iTerm "Stable" Window
if ( [terminalWindow isEqualToString:@"current"] ) {
[self runScript:iTermLegacyCurrentWindow handler:handlerName parameters:passParameters];
}
//we are using the default action of shuttle... The active window in a new tab
if ( [terminalWindow isEqualToString:@"tab"] ) {
[self runScript:iTermLegacyNewTabDefault handler:handlerName parameters:passParameters];
}
}
//iTermVersion is not set to "legacy" using applescripts Configured for Stable
if( [iTermVersionPref isEqualToString:@"stable"]) {

//run the applescript that works with iTerm Stable
//if we are running in a new iTerm "Stable" Window
if ( [terminalWindow isEqualToString:@"new"] ) {
[self runScript:iTermStableNewWindow handler:handlerName parameters:passParameters];
Expand All @@ -502,7 +524,7 @@ - (void) openHost:(NSMenuItem *) sender {
}
//we are using the default action of shuttle... The active window in a new tab
if ( [terminalWindow isEqualToString:@"tab"] ) {
[self runScript:iTermStableNewTabDefault handler:handlerName parameters:passParameters];
[self runScript:iTermStableNewTabDefault handler:handlerName parameters:passParameters];
}
}
//iTermVersion is not set to "stable" using applescripts Configured for Nightly
Expand Down
4 changes: 2 additions & 2 deletions Shuttle/Shuttle-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2.6</string>
<string>1.2.7</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.2.6</string>
<string>1.2.7</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Shuttle/apple-scpt/iTerm2-nightly-current-window.scpt
Binary file not shown.
Binary file modified Shuttle/apple-scpt/iTerm2-nightly-new-tab-default.scpt
Binary file not shown.
Binary file modified Shuttle/apple-scpt/iTerm2-nightly-new-window.scpt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Shuttle/apple-scpt/iTerm2-stable-new-window.scpt
Binary file not shown.
7 changes: 7 additions & 0 deletions apple-scripts/compile-iTermLegacy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
echo "compiling applescripts for iTerm Legacy..."
osacompile -o ~/Git/shuttle/Shuttle/apple-scpt/iTerm-legacy-new-window.scpt -x ~/Git/shuttle/apple-scripts/iTermlegacy/iTerm-legacy-new-window.applescript
osacompile -o ~/Git/shuttle/Shuttle/apple-scpt/iTerm-legacy-current-window.scpt -x ~/Git/shuttle/apple-scripts/iTermlegacy/iTerm-legacy-current-window.applescript
osacompile -o ~/Git/shuttle/Shuttle/apple-scpt/iTerm-legacy-new-tab-default.scpt -x ~/Git/shuttle/apple-scripts/iTermlegacy/iTerm-legacy-new-tab-default.applescript


6 changes: 3 additions & 3 deletions apple-scripts/compile-iTermStable.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
echo "compiling applescripts for iTerm Stable..."
osacompile -o ~/Git/shuttle/Shuttle/apple-scpt/iTerm-stable-new-window.scpt -x ~/Git/shuttle/apple-scripts/iTermStable/iTerm-stable-new-window.applescript
osacompile -o ~/Git/shuttle/Shuttle/apple-scpt/iTerm-stable-current-window.scpt -x ~/Git/shuttle/apple-scripts/iTermStable/iTerm-stable-current-window.applescript
osacompile -o ~/Git/shuttle/Shuttle/apple-scpt/iTerm-stable-new-tab-default.scpt -x ~/Git/shuttle/apple-scripts/iTermStable/iTerm-stable-new-tab-default.applescript
osacompile -o ~/Git/shuttle/Shuttle/apple-scpt/iTerm2-stable-new-window.scpt -x ~/Git/shuttle/apple-scripts/iTermStable/iTerm2-stable-new-window.applescript
osacompile -o ~/Git/shuttle/Shuttle/apple-scpt/iTerm2-stable-current-window.scpt -x ~/Git/shuttle/apple-scripts/iTermStable/iTerm2-stable-current-window.applescript
osacompile -o ~/Git/shuttle/Shuttle/apple-scpt/iTerm2-stable-new-tab-default.scpt -x ~/Git/shuttle/apple-scripts/iTermStable/iTerm2-stable-new-tab-default.applescript


23 changes: 23 additions & 0 deletions apple-scripts/iTermStable/iTerm2-stable-current-window.applescript
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
--for testing uncomment the "on run" block
--on run
-- set argsCmd to "ps aux | grep [s]sh"
-- scriptRun(argsCmd)
--end run

on scriptRun(argsCmd)
set withCmd to (argsCmd)
CommandRun(withCmd)
end scriptRun

on CommandRun(withCmd)
tell application "iTerm"
reopen
activate
tell the current window
tell the current session
--set name to theTitle
write text withCmd
end tell
end tell
end tell
end CommandRun
Loading