Check if application is in dock?

Hi, how do I check if an application is in the dock?

Hi,

try this


checkIfAppIsInDock("Finder") --> returns boolean true or false

on checkIfAppIsInDock(theApp)
	tell application "System Events" to tell process "Dock"
		set dockApps to name of UI elements of list 1 whose subrole is "AXApplicationDockItem"
	end tell
	return theApp is in dockApps
end checkIfAppIsInDock


:smiley: Wow! Thanks! I wasn’t sure if it was possible, it works!