不需要时杀死所有 Adob​​e 后台进程 MAC

Out*_*ter 5 macos adobe apple-m1

此代码和问题是 Ted Wrigley 的Perfectfiasco问题和答案的后续内容。

我也发现 Adob​​e 在后台运行了多少个进程,即使在禁用了 finder 扩展并且不使用任何应用程序的情况下也是如此。

要杀死的进程的屏幕截图

我正在尝试创建类似的东西,但对于另外 3 个应用程序以及 Lightroom / Creative Cloud 和 Adob​​e Bridge 也做了一些编辑,以包括 Adob​​e 在后台运行的所有其他进程。知道我是否正确添加了这些吗?

不完全确定如何将应用程序与进程分开,以及是否有必要杀死所有应用程序或只是退出命令?

强制退出这样的进程和应用程序可以吗?

我注意到,如果许多 adobe 进程退出,那么它会启动这个守护进程“AdobeCRDaemon”,这是预期的吗?

不知道要放在这里什么,现在已经添加了几个其他进程 - 告诉进程“AGMService”

代码中的其他内容是否需要针对当前 macOS Monterey 进行更新?

预先感谢您的任何澄清

use AppleScript version "2.4"
use framework "AppKit"
use scripting additions

property NSWorkspace : class "NSWorkspace"

on run
    set workSp to NSWorkspace's sharedWorkspace()
    set notifCent to workSp's notificationCenter()
    tell notifCent to addObserver:me selector:"someAppHasTerminated:" |name|:"NSWorkspaceDidTerminateApplicationNotification" object:(missing value)
end run

on idle
    -- we don't use the idle loop, so tell the system let the app sleep. this comes out of idle once an hour
    return 3600
end idle

on someAppHasTerminated:notif
    set termedApp to (notif's userInfo's valueForKey:"NSWorkspaceApplicationKey")
    set termedAppName to (termedApp's localizedName) as text
    -- I'm guessing at the localized names for Photoshop and Illustrator. you may need to alter these
    if termedAppName is "Adobe Photoshop 2022" or termedAppName is "Adobe Lightroom Classic" or termedAppName is "Adobe Bridge 2022" or termedAppName is "Adobe Lightroom" or termedAppName is "Creative Cloud" then
        -- close the service here
        tell application "System Events"
            tell process "AGMService"
                if its accepts high level events is true then
                    tell application "AGMService" to quit
             tell application "Adobe Desktop Service" to quit
               tell application "CCLibrary" to quit
            tell application "CCXProcess" to quit
             tell application "Core Sync" to quit
              tell application "Creative Cloud Helper" to quit
                else
                    do shell script "killall AGMService"
            do shell script "killall Adobe Desktop Service"
             do shell script "killall CCLibrary"
              do shell script "killall CCXProcess"
               do shell script "killall Core Sync"
            do shell script "killall Creative Cloud Helper"
                end if
            end tell
        end tell
    end if
end someAppHasTerminated:
Run Code Online (Sandbox Code Playgroud)

小智 1

这是一种非常不安全的方法,但我已经将嵌套tell地狱替换onAppHasTerminated为:

do shell script "pkill -i -f adobe"

我的个人脚本如下所示