From 17e2c884fe5598dc7fa33d50ff46bfd7bd2e6742 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Mon, 27 Nov 2023 19:58:37 -0600 Subject: [PATCH] Catch error that occurs if the opening app quits while the script is running. --- source/JJApplicationDelegate.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/JJApplicationDelegate.m b/source/JJApplicationDelegate.m index 7dc988f..763818e 100644 --- a/source/JJApplicationDelegate.m +++ b/source/JJApplicationDelegate.m @@ -109,7 +109,9 @@ repeat while (count menu bars) = 0\n\ click menu item %@ of menu 1 of menu bar item 3 of menu bar 1\n\ end tell\n\ if (restoreold) then\n\ + try\n\ set frontmost of oldapp to true\n\ + end try\n\ end if\n\ end tell"; NSString* menuItem = [@PRODUCT_NAME isEqualToString:@"PrivateWindow"] ? @"2" : @"1";