Skip to content

Commit 39cb101

Browse files
committed
+[SSYOtherApper quitThisUsersAppWithBundlePath:closeWindows:wasRunning_p:error_p:] now works with apps that throw an AppleScript error when told to 'close windows'.
1 parent 190531a commit 39cb101

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

SSYOtherApper.m

+4-1
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,10 @@ + (BOOL)quitThisUsersAppWithBundlePath:(NSString*)bundlePath
522522
@"tell application \"%@\"\n",
523523
bundlePath] ;
524524
if (closeWindows) {
525-
source = [source stringByAppendingString:@"close windows\n"] ;
525+
/* We enclose 'close windows' in a 'try' block because some apps,
526+
such as iCab 6 running in macOS 10.11.2, throw an AppleScript
527+
error when told to 'close windows'. */
528+
source = [source stringByAppendingString:@"try\nclose windows\nend try\n"] ;
526529
}
527530
source = [source stringByAppendingString:@"quit\nend tell"] ;
528531

0 commit comments

Comments
 (0)