Tuesday, September 29, 2020

#1 2020-09-15 10:16:15 am

KniazidisR
Member
Registered: 2019-03-03
Posts: 1311

Restart Application

Yes, I know it already happened. But let me suggest my version for restarting active applications. If there is a better option, then I will only be glad to see it here.

Applescript:


tell application "System Events" to set appNames to name of every application process
set currentApplicationName to name of current application

set appName to (choose from list appNames)
if appName is false then return
set appName to item 1 of appName
if appName is currentApplicationName then return

tell application appName to quit

tell application "System Events"
   repeat while appName is in (name of application processes)
       delay 0.2
   end repeat
end tell

try
   tell application appName to launch
on error
   try
       tell application appName to activate
   end try
end try

tell current application to activate

Last edited by KniazidisR (2020-09-15 10:27:24 am)


Model: MacBook Pro
OS X: Catalina 10.15.4
Web Browser: Safari 13.1
Ram: 4 GB

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)