这段代码和问题是由Ted从完美失败问答开始的。
我也发现,Adobe在后台运行了多少进程--即使当finder扩展被禁用并且不使用任何应用程序时,我也觉得很疯狂。
我正在尝试创建一些类似的东西,但对于另外3个应用程序,还包括Lightroom / creative和adobe,并对其进行了轻微的编辑,以包括Adobe在后台运行的所有其他进程。你知道我是否正确地加了这些吗?
不完全确定如何将应用程序从进程中分离出来,是否有必要对应用程序使用killall,或者干脆退出命令?
强制退出进程和这样的应用程序可以吗?
我注意到的是,如果大量的adobe进程被退出,那么它会启动这个守护进程"AdobeCRDaemon“,这是预期的吗?
现在还不确定在这里添加了其他几个进程--告诉进程"AGMService“
对于当前的macOS蒙特雷,代码中还有什么需要更新吗?
谢谢您的任何澄清
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:
发布于 2022-01-02 21:54:35
这是一种非常不安全的方法,但我已经替换了onAppHasTerminated
中嵌套的onAppHasTerminated
地狱:
do shell script "pkill -i -f adobe"
我的个人剧本看起来像这。
发布于 2022-06-14 20:36:03
我也有同样的问题。只需在终端中运行以下命令:
杀死$(ps aux \ grep -i '.adobe‘\ grep -v grep \ awk '{print $2}')
https://stackoverflow.com/questions/69959420
复制相似问题