Skip to content

Commit

Permalink
fix: try to fix run apple script crash
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng committed Jan 8, 2023
1 parent 7470458 commit 63c94f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Easydict/Feature/Service/Apple/EZExeCommand.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ - (void)runAppleScript:(NSString *)script completionHandler:(void (^)(NSString *

NSData *errorData = [[errorPipe fileHandleForReading] readDataToEndOfFile];
NSString *errorString = [[NSString alloc] initWithData:errorData encoding:NSUTF8StringEncoding];
if (task.terminationStatus != 0) {

// *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSConcreteTask terminationStatus]: task still running'
if (errorString.length) {
// 34:114: execution error: “Shortcuts Events”遇到一个错误:不能获得“shortcut "123abc"”。 (-1728)
errorString = [errorString trim];
NSArray *array = [errorString componentsSeparatedByString:@"execution error: "];
Expand Down

0 comments on commit 63c94f8

Please sign in to comment.