Skip to content

Commit 16a8c8a

Browse files
author
Matt Turner
authored
Merge pull request #183 from thshdw/Fixes-for-1.2.7
Fixes for 1.2.7 * Corrected an issue where commas in commands would not be parsed. #173 * Changed the directive names for iTerm_version. Valid names are legacy, stable, nightly. #181 * Contains new icons by @pluwen #141 * Contains an apple script fix by @mortonfox where an iTerm setting would prevent scripts from running #175
2 parents 02ee727 + 9df7c61 commit 16a8c8a

20 files changed

+209
-28
lines changed

Shuttle.xcodeproj/project.pbxproj

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313
0ADB3B0F178EF8DB004E9BB9 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 0ADB3B0B178EF8DB004E9BB9 /* [email protected] */; };
1414
0ADB3B13178F3DE4004E9BB9 /* LaunchAtLoginController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0ADB3B12178F3DE4004E9BB9 /* LaunchAtLoginController.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
1515
7E74A7C61789CE2F0079E0D2 /* shuttle.default.json in Resources */ = {isa = PBXBuildFile; fileRef = 7E74A7C51789CE2F0079E0D2 /* shuttle.default.json */; };
16-
A12D9BF01BCF2C73004F52A6 /* iTerm-stable-current-window.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A12D9BE71BCF2C72004F52A6 /* iTerm-stable-current-window.scpt */; };
17-
A12D9BF11BCF2C73004F52A6 /* iTerm-stable-new-tab-default.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A12D9BE81BCF2C72004F52A6 /* iTerm-stable-new-tab-default.scpt */; };
18-
A12D9BF21BCF2C73004F52A6 /* iTerm-stable-new-window.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A12D9BE91BCF2C72004F52A6 /* iTerm-stable-new-window.scpt */; };
16+
A124BA191D45572B00218F2F /* iTerm2-stable-current-window.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A124BA161D45572B00218F2F /* iTerm2-stable-current-window.scpt */; };
17+
A124BA1A1D45572B00218F2F /* iTerm2-stable-new-tab-default.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A124BA171D45572B00218F2F /* iTerm2-stable-new-tab-default.scpt */; };
18+
A124BA1B1D45572B00218F2F /* iTerm2-stable-new-window.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A124BA181D45572B00218F2F /* iTerm2-stable-new-window.scpt */; };
19+
A124BA1F1D4558E500218F2F /* iTerm-legacy-current-window.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A124BA1C1D4558E500218F2F /* iTerm-legacy-current-window.scpt */; };
20+
A124BA201D4558E500218F2F /* iTerm-legacy-new-tab-default.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A124BA1D1D4558E500218F2F /* iTerm-legacy-new-tab-default.scpt */; };
21+
A124BA211D4558E500218F2F /* iTerm-legacy-new-window.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A124BA1E1D4558E500218F2F /* iTerm-legacy-new-window.scpt */; };
1922
A12D9BF31BCF2C73004F52A6 /* iTerm2-nightly-current-window.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A12D9BEA1BCF2C73004F52A6 /* iTerm2-nightly-current-window.scpt */; };
2023
A12D9BF41BCF2C73004F52A6 /* iTerm2-nightly-new-tab-default.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A12D9BEB1BCF2C73004F52A6 /* iTerm2-nightly-new-tab-default.scpt */; };
2124
A12D9BF51BCF2C73004F52A6 /* iTerm2-nightly-new-window.scpt in Resources */ = {isa = PBXBuildFile; fileRef = A12D9BEC1BCF2C73004F52A6 /* iTerm2-nightly-new-window.scpt */; };
@@ -42,9 +45,12 @@
4245
0ADB3B12178F3DE4004E9BB9 /* LaunchAtLoginController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LaunchAtLoginController.m; sourceTree = "<group>"; };
4346
7E72D21E178003ED00A6389C /* Shuttle.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Shuttle.entitlements; sourceTree = "<group>"; };
4447
7E74A7C51789CE2F0079E0D2 /* shuttle.default.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = shuttle.default.json; sourceTree = "<group>"; };
45-
A12D9BE71BCF2C72004F52A6 /* iTerm-stable-current-window.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm-stable-current-window.scpt"; sourceTree = "<group>"; };
46-
A12D9BE81BCF2C72004F52A6 /* iTerm-stable-new-tab-default.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm-stable-new-tab-default.scpt"; sourceTree = "<group>"; };
47-
A12D9BE91BCF2C72004F52A6 /* iTerm-stable-new-window.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm-stable-new-window.scpt"; sourceTree = "<group>"; };
48+
A124BA161D45572B00218F2F /* iTerm2-stable-current-window.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm2-stable-current-window.scpt"; sourceTree = "<group>"; };
49+
A124BA171D45572B00218F2F /* iTerm2-stable-new-tab-default.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm2-stable-new-tab-default.scpt"; sourceTree = "<group>"; };
50+
A124BA181D45572B00218F2F /* iTerm2-stable-new-window.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm2-stable-new-window.scpt"; sourceTree = "<group>"; };
51+
A124BA1C1D4558E500218F2F /* iTerm-legacy-current-window.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm-legacy-current-window.scpt"; sourceTree = "<group>"; };
52+
A124BA1D1D4558E500218F2F /* iTerm-legacy-new-tab-default.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm-legacy-new-tab-default.scpt"; sourceTree = "<group>"; };
53+
A124BA1E1D4558E500218F2F /* iTerm-legacy-new-window.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm-legacy-new-window.scpt"; sourceTree = "<group>"; };
4854
A12D9BEA1BCF2C73004F52A6 /* iTerm2-nightly-current-window.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm2-nightly-current-window.scpt"; sourceTree = "<group>"; };
4955
A12D9BEB1BCF2C73004F52A6 /* iTerm2-nightly-new-tab-default.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm2-nightly-new-tab-default.scpt"; sourceTree = "<group>"; };
5056
A12D9BEC1BCF2C73004F52A6 /* iTerm2-nightly-new-window.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTerm2-nightly-new-window.scpt"; sourceTree = "<group>"; };
@@ -96,9 +102,12 @@
96102
A12D9BE61BCF2C72004F52A6 /* apple-scpt */ = {
97103
isa = PBXGroup;
98104
children = (
99-
A12D9BE71BCF2C72004F52A6 /* iTerm-stable-current-window.scpt */,
100-
A12D9BE81BCF2C72004F52A6 /* iTerm-stable-new-tab-default.scpt */,
101-
A12D9BE91BCF2C72004F52A6 /* iTerm-stable-new-window.scpt */,
105+
A124BA1C1D4558E500218F2F /* iTerm-legacy-current-window.scpt */,
106+
A124BA1D1D4558E500218F2F /* iTerm-legacy-new-tab-default.scpt */,
107+
A124BA1E1D4558E500218F2F /* iTerm-legacy-new-window.scpt */,
108+
A124BA161D45572B00218F2F /* iTerm2-stable-current-window.scpt */,
109+
A124BA171D45572B00218F2F /* iTerm2-stable-new-tab-default.scpt */,
110+
A124BA181D45572B00218F2F /* iTerm2-stable-new-window.scpt */,
102111
A12D9BEA1BCF2C73004F52A6 /* iTerm2-nightly-current-window.scpt */,
103112
A12D9BEB1BCF2C73004F52A6 /* iTerm2-nightly-new-tab-default.scpt */,
104113
A12D9BEC1BCF2C73004F52A6 /* iTerm2-nightly-new-window.scpt */,
@@ -232,22 +241,25 @@
232241
A12D9BF61BCF2C73004F52A6 /* terminal-current-window.scpt in Resources */,
233242
A12D9BF31BCF2C73004F52A6 /* iTerm2-nightly-current-window.scpt in Resources */,
234243
A12D9BF51BCF2C73004F52A6 /* iTerm2-nightly-new-window.scpt in Resources */,
235-
A12D9BF21BCF2C73004F52A6 /* iTerm-stable-new-window.scpt in Resources */,
236244
0ADB3B0D178EF8DB004E9BB9 /* StatusIcon.png in Resources */,
237-
A12D9BF11BCF2C73004F52A6 /* iTerm-stable-new-tab-default.scpt in Resources */,
245+
A124BA1F1D4558E500218F2F /* iTerm-legacy-current-window.scpt in Resources */,
238246
0ADB3B0C178EF8DB004E9BB9 /* StatusIconAlt.png in Resources */,
239247
C149EC0815D5214600B1F558 /* InfoPlist.strings in Resources */,
240248
A1D700091A5DCFE1003563E4 /* AboutWindowController.xib in Resources */,
241249
0ADB3B0F178EF8DB004E9BB9 /* [email protected] in Resources */,
242250
0ADB3B0E178EF8DB004E9BB9 /* [email protected] in Resources */,
251+
A124BA191D45572B00218F2F /* iTerm2-stable-current-window.scpt in Resources */,
243252
A12D9BF41BCF2C73004F52A6 /* iTerm2-nightly-new-tab-default.scpt in Resources */,
244253
C149EC0E15D5214600B1F558 /* Credits.rtf in Resources */,
245-
A12D9BF01BCF2C73004F52A6 /* iTerm-stable-current-window.scpt in Resources */,
246254
A12D9BF71BCF2C73004F52A6 /* terminal-new-tab-default.scpt in Resources */,
247255
C149EC1415D5214600B1F558 /* MainMenu.xib in Resources */,
256+
A124BA1B1D45572B00218F2F /* iTerm2-stable-new-window.scpt in Resources */,
257+
A124BA1A1D45572B00218F2F /* iTerm2-stable-new-tab-default.scpt in Resources */,
248258
C159DC2815D5DE8000F5DE24 /* shuttle.icns in Resources */,
249259
A12D9BF81BCF2C73004F52A6 /* terminal-new-window.scpt in Resources */,
250260
7E74A7C61789CE2F0079E0D2 /* shuttle.default.json in Resources */,
261+
A124BA201D4558E500218F2F /* iTerm-legacy-new-tab-default.scpt in Resources */,
262+
A124BA211D4558E500218F2F /* iTerm-legacy-new-window.scpt in Resources */,
251263
);
252264
runOnlyForDeploymentPostprocessing = 0;
253265
};

Shuttle/AppDelegate.m

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ - (void) buildMenu:(NSArray*)data addToMenu:(NSMenu *)m {
365365
NSString *menuName = cfg[@"name"];
366366

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

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

384384

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

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

446+
//Set Paths to iTerm Legacy AppleScripts
447+
NSString *iTermLegacyNewWindow = [[NSBundle mainBundle] pathForResource:@"iTerm-legacy-new-window" ofType:@"scpt"];
448+
NSString *iTermLegacyCurrentWindow = [[NSBundle mainBundle] pathForResource:@"iTerm-legacy-current-window" ofType:@"scpt"];
449+
NSString *iTermLegacyNewTabDefault = [[NSBundle mainBundle] pathForResource:@"iTerm-legacy-new-tab-default" ofType:@"scpt"];
450+
446451
//Set Paths to iTerm Stable AppleScripts
447-
NSString *iTermStableNewWindow = [[NSBundle mainBundle] pathForResource:@"iTerm-stable-new-window" ofType:@"scpt"];
448-
NSString *iTermStableCurrentWindow = [[NSBundle mainBundle] pathForResource:@"iTerm-stable-current-window" ofType:@"scpt"];
449-
NSString *iTermStableNewTabDefault = [[NSBundle mainBundle] pathForResource:@"iTerm-stable-new-tab-default" ofType:@"scpt"];
452+
NSString *iTermStableNewWindow = [[NSBundle mainBundle] pathForResource:@"iTerm2-stable-new-window" ofType:@"scpt"];
453+
NSString *iTermStableCurrentWindow = [[NSBundle mainBundle] pathForResource:@"iTerm2-stable-current-window" ofType:@"scpt"];
454+
NSString *iTermStableNewTabDefault = [[NSBundle mainBundle] pathForResource:@"iTerm2-stable-new-tab-default" ofType:@"scpt"];
450455

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

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

479484
if( iTermVersionPref == 0 ) {
480-
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.";
481-
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.";
485+
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.";
486+
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.";
482487
[self throwError:errorMessage additionalInfo:errorInfo continueOnErrorOption:YES];
483488
iTermVersionPref = @"stable";
484489

@@ -489,9 +494,26 @@ - (void) openHost:(NSMenuItem *) sender {
489494
}
490495
}
491496

492-
if( [iTermVersionPref isEqualToString:@"stable"]) {
497+
if( [iTermVersionPref isEqualToString:@"legacy"]) {
493498

494-
//run the applescript that works with iTerm Stable
499+
//run the applescript that works with iTerm Legacy
500+
//if we are running in a new iTerm "Stable" Window
501+
if ( [terminalWindow isEqualToString:@"new"] ) {
502+
[self runScript:iTermLegacyNewWindow handler:handlerName parameters:passParameters];
503+
}
504+
//if we are running in the current iTerm "Stable" Window
505+
if ( [terminalWindow isEqualToString:@"current"] ) {
506+
[self runScript:iTermLegacyCurrentWindow handler:handlerName parameters:passParameters];
507+
}
508+
//we are using the default action of shuttle... The active window in a new tab
509+
if ( [terminalWindow isEqualToString:@"tab"] ) {
510+
[self runScript:iTermLegacyNewTabDefault handler:handlerName parameters:passParameters];
511+
}
512+
}
513+
//iTermVersion is not set to "legacy" using applescripts Configured for Stable
514+
if( [iTermVersionPref isEqualToString:@"stable"]) {
515+
516+
//run the applescript that works with iTerm Stable
495517
//if we are running in a new iTerm "Stable" Window
496518
if ( [terminalWindow isEqualToString:@"new"] ) {
497519
[self runScript:iTermStableNewWindow handler:handlerName parameters:passParameters];
@@ -502,7 +524,7 @@ - (void) openHost:(NSMenuItem *) sender {
502524
}
503525
//we are using the default action of shuttle... The active window in a new tab
504526
if ( [terminalWindow isEqualToString:@"tab"] ) {
505-
[self runScript:iTermStableNewTabDefault handler:handlerName parameters:passParameters];
527+
[self runScript:iTermStableNewTabDefault handler:handlerName parameters:passParameters];
506528
}
507529
}
508530
//iTermVersion is not set to "stable" using applescripts Configured for Nightly

Shuttle/Shuttle-Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.2.6</string>
20+
<string>1.2.7</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>1.2.6</string>
24+
<string>1.2.7</string>
2525
<key>LSApplicationCategoryType</key>
2626
<string>public.app-category.developer-tools</string>
2727
<key>LSMinimumSystemVersion</key>
0 Bytes
Binary file not shown.
18 Bytes
Binary file not shown.
20 Bytes
Binary file not shown.
1.08 KB
Binary file not shown.

0 commit comments

Comments
 (0)