From 0e2815a618852d40080c6ab4194b0554d088ad02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olof=20Thor=C3=A9n?= Date: Thu, 22 Nov 2018 08:32:58 +0100 Subject: [PATCH] Update Refresh Running Browsers.tmCommand Check that opera exists before asking finder about it. (Otherwise nothing will happen). Also if safari exist, switch to it. --- Commands/Refresh Running Browsers.tmCommand | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Commands/Refresh Running Browsers.tmCommand b/Commands/Refresh Running Browsers.tmCommand index 2fbac6a..01e23b3 100644 --- a/Commands/Refresh Running Browsers.tmCommand +++ b/Commands/Refresh Running Browsers.tmCommand @@ -11,6 +11,7 @@ if application "Safari" is running then tell application "Safari" set sameURL to URL of current tab of front window set URL of current tab of front window to sameURL + set application "Safari" to activate end tell end if @@ -63,6 +64,12 @@ on error -- do nothing end try +set doesExist to false +try + do shell script "osascript -e 'exists application \"Opera\"'" + set doesExist to true +end try +if doesExist then try tell application "Finder" name of application file id "com.operasoftware.Opera" @@ -77,6 +84,8 @@ try on error -- do nothing end try +endif + input none