How to access OSX's inline AppleSpell service

I am working on a project that monitor’s AppleSpell by polling the Activity Monitor (seeing when AppleSpell is active). This method is not very reliable since polling the active applications is sometimes slow. Who might I contact at Apple that might allow me to adapt my application to their AppleSpell service?

System Events would be a much better way to see what process are running.

tell application "System Events"
	set runningProcesses to name of every process
end tell

if runningProcesses contains "AppleSpell" then
	return "applespell is running"
	return "applescpell is not running"
end if

Thanks for the scripting suggestion about the System Events check, Regulus. For my particular application, I need to constantly monitor System Events to see when AppleSpell becomes active. This requires that your script example is put within some kind of ongoing loop structure. This is what I mean by “polling.” The loop contains a short pause to keep the CPU usage reasonable, however this short duration is where I sometime miss the occasion to capture information–a spelling change in this case. In order to avoid this inherent weakness with polling, I believe the best solution is getting access to AppleSpell’s API, if it were possible–unfortunately AppleSpell is not AppleScriptable :frowning:

In follow-up to my quest for capturing AppleSpell changes, I find that this problem is best handled through Apple’s Accessibility API which is largely scriptable. See AppleScript’s UI Actions dictionary or PreFab UI Actions tool for solutions. I will have to play with this stuff until I get the hang of it, but it looks promising. :cool: