You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Quitting Adobe Acrobat Reader

I am using this script to quit all open apps:


tell application "System Events" to set quitapps to name of every application process whose visible is true and name is not "Finder"

repeat with closeall in quitapps

quit application closeall

end repeat


For whatever reason Adobe Acrobat Reader DC sometimes does not respond. What can I add to this script to be sure to quit Adobe if it is running?


Thanks

iMac Line (2012 and Later)

Posted on Dec 28, 2020 11:04 AM

Reply
Question marked as Top-ranking reply

Posted on Dec 28, 2020 11:57 AM

Adobe Acrobat Reader does not respond to AppleScript terminology as it has no scripting dictionary support. Thus you have to use a do shell script and pass the name of the process (AdobeReader) as an argument to pkill and send a termination signal (SIGTERM -15) to kill the application.


tell application "System Events"
	activate
	set quitapps to name of every application process whose visible is true and name is not "Finder"
	
	repeat with p in quitapps
		if process p's name contains "AdobeReader" then
			(do shell script "pkill -x " & process p's name & " -15")
		end if
	end repeat
end tell


8 replies
Question marked as Top-ranking reply

Dec 28, 2020 11:57 AM in response to mrokloricred37

Adobe Acrobat Reader does not respond to AppleScript terminology as it has no scripting dictionary support. Thus you have to use a do shell script and pass the name of the process (AdobeReader) as an argument to pkill and send a termination signal (SIGTERM -15) to kill the application.


tell application "System Events"
	activate
	set quitapps to name of every application process whose visible is true and name is not "Finder"
	
	repeat with p in quitapps
		if process p's name contains "AdobeReader" then
			(do shell script "pkill -x " & process p's name & " -15")
		end if
	end repeat
end tell


Jan 1, 2021 9:52 AM in response to mrokloricred37

For the same reasons as Adobe Acrobat Reader DC, if the application that you tell System Events to quit, does not respond to an AppleScript originated event, you will need to introduce another else if that uses pkill to handle that specific application, or a try/end try block that calls a function to use pkill to quit the process.


tell application "System Events"
	activate
	set quitapps to name of every application process whose visible is true and name is not "Finder"
	
	repeat with closeall in quitapps
		if not (process closeall's name contains "AdobeReader") then
			quit application closeall
		else
			(do shell script "pkill -x " & process closeall's name & " -15")
		end if
	end repeat
end tell
return


Jan 7, 2021 3:25 PM in response to VikingOSX

Sorry that I missed your RSVP

I am looking to quit all apps including adobe (Word, Excel etc). Your latest script for me just quits adobe.

"My" original script often works including adobe, but frequently leaves adobe open with a warning box RE: not quitting adobe.

Clearly, I am missing something, but isn't there a way to quit all apps and kill Adobe due to its "issues" that you previously described?

Thanks for your patience


Quitting Adobe Acrobat Reader

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.