Skip to content

Instantly share code, notes, and snippets.

@lazuee
Forked from samhenrigold/De-dobe.scpt
Last active April 5, 2026 16:56
Show Gist options
  • Select an option

  • Save lazuee/e7a50e7b0cb700ce57249dadde446178 to your computer and use it in GitHub Desktop.

Select an option

Save lazuee/e7a50e7b0cb700ce57249dadde446178 to your computer and use it in GitHub Desktop.
Kill all Adobe CC daemons on app quit
use framework "AppKit"
use scripting additions
property whitelist : {"com.adobe.adobe-animate*"}
on run
set workSpace to current application's NSWorkspace's sharedWorkspace()
set notificationCenter to workSpace's notificationCenter()
tell notificationCenter to addObserver:me selector:"someAppHasTerminated:" |name|:"NSWorkspaceDidTerminateApplicationNotification" object:(missing value)
tell notificationCenter to addObserver:me selector:"someAppHasLaunched:" |name|:"NSWorkspaceDidLaunchApplicationNotification" object:(missing value)
end run
on idle
if not my isWhitelistRunning() then
my killAllAdobe()
end if
return 15
end idle
on quit
set workSpace to current application's NSWorkspace's sharedWorkspace()
set notificationCenter to workSpace's notificationCenter()
tell notificationCenter to removeObserver:me
continue quit
end quit
on toLower(str)
return ((current application's NSString's stringWithString:str)'s lowercaseString()) as text
end toLower
on killAllAdobe()
set workSpace to current application's NSWorkspace's sharedWorkspace()
set runningApps to workSpace's runningApplications()
set appCount to runningApps's |count|()
repeat with i from 0 to (appCount - 1)
set anApp to runningApps's objectAtIndex:i
set appBundleID to anApp's bundleIdentifier()
if appBundleID is not missing value then
if (appBundleID as text) starts with "com.adobe" then
set appPID to (anApp's processIdentifier()) as integer
do shell script "kill -9 " & appPID
end if
end if
end repeat
do shell script "pgrep -f -i 'adobe' | xargs kill -9 2>/dev/null; true"
end killAllAdobe
on isWhitelistRunning()
set workSpace to current application's NSWorkspace's sharedWorkspace()
set runningApps to workSpace's runningApplications()
set appCount to runningApps's |count|()
repeat with i from 0 to (appCount - 1)
set anApp to runningApps's objectAtIndex:i
set appBundleID to anApp's bundleIdentifier()
if appBundleID is not missing value then
set appIDStr to my toLower(appBundleID as text)
repeat with bundlePattern in whitelist
if my matchesPattern(appIDStr, bundlePattern as text) then return true
end repeat
end if
end repeat
return false
end isWhitelistRunning
on someAppHasTerminated:notif
set termedApp to (notif's userInfo's valueForKey:"NSWorkspaceApplicationKey")
set termedBundleID to termedApp's bundleIdentifier()
if termedBundleID is missing value then return
set termedAppID to my toLower(termedBundleID as text)
repeat with bundlePattern in whitelist
if my matchesPattern(termedAppID, bundlePattern as text) then
my killAllAdobe()
return
end if
end repeat
end someAppHasTerminated:
on someAppHasLaunched:notif
set launchedApp to (notif's userInfo's valueForKey:"NSWorkspaceApplicationKey")
set launchedBundleID to launchedApp's bundleIdentifier()
if launchedBundleID is missing value then return
set launchedAppID to my toLower(launchedBundleID as text)
if not (launchedAppID starts with "com.adobe") then return
repeat with bundlePattern in whitelist
if my matchesPattern(launchedAppID, bundlePattern as text) then return
end repeat
if not my isWhitelistRunning() then
my killAllAdobe()
end if
end someAppHasLaunched:
on matchesPattern(str, pattern)
set AppleScript's text item delimiters to "*"
set parts to text items of pattern
set AppleScript's text item delimiters to ""
set partCount to count of parts
if partCount is 1 then return str is equal to pattern
set remaining to str
set prefixPart to item 1 of parts
if prefixPart is not "" then
if (length of remaining) < (length of prefixPart) then return false
if not (remaining starts with prefixPart) then return false
if (length of remaining) is (length of prefixPart) then
set remaining to ""
else
set remaining to text ((length of prefixPart) + 1) thru -1 of remaining
end if
end if
set suffixPart to item partCount of parts
if suffixPart is not "" then
if (length of remaining) < (length of suffixPart) then return false
if not (remaining ends with suffixPart) then return false
if (length of remaining) is (length of suffixPart) then
set remaining to ""
else
set remaining to text 1 thru ((length of remaining) - (length of suffixPart)) of remaining
end if
end if
if partCount > 2 then
repeat with i from 2 to (partCount - 1)
set midPart to item i of parts
if midPart is not "" then
if remaining is "" then return false
set pos to offset of midPart in remaining
if pos is 0 then return false
set newStart to pos + (length of midPart)
if newStart > (length of remaining) then
set remaining to ""
else
set remaining to text newStart thru -1 of remaining
end if
end if
end repeat
end if
return true
end matchesPattern
# compile the script to app
osacompile -o /Applications/De-dobe.app ~/Downloads/De-dobe.scpt
defaults write /Applications/De-dobe.app/Contents/Info.plist OSAAppletStayOpen -bool YES
defaults write /Applications/De-dobe.app/Contents/Info.plist LSUIElement -bool YES
xattr -cr /Applications/De-dobe.app
# create launchAgent
cat > ~/Library/LaunchAgents/dev.lazuee.dedobe.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>dev.lazuee.dedobe</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/open</string>
<string>-a</string>
<string>/Applications/De-dobe.app</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
</dict>
</plist>
EOF
# start launchAgent
osascript -e 'tell application "De-dobe" to quit'
launchctl unload ~/Library/LaunchAgents/dev.lazuee.dedobe.plist
launchctl load ~/Library/LaunchAgents/dev.lazuee.dedobe.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment