Using Automator Programmatically ("Behind the Scenes")
I'm very new to Cocoa/Objective-C development. As a matter of fact, I'm a recent Computer Science graduate who wants to move into the Mac development field. I have a strong background in C++/Java/OOP in general, so I figured I'd try my hand at developing a little Cocoa application to get the feel for Objective-C.
I want to make an application that makes use of OS X's built-in New Oxford American Dictionary. I tried exploring the raw data files for the dictionaries in /Library/Dictionaries, but it seems that the non-Apple Dictionaries are encrypted (or are at least not in immediately usable form -- researching this online gave me nothing useful).
I then noticed that 10.5's Automator comes with a "Get Definition of Word" action that does exactly what I want: give a single-word text input and return a simple text output with the word's definition. So I thought, "Great. I'm sure I can figure out how to use Automator 'behind the scenes' in Objective-C to look up definitions for my program." (In case you're wondering why the heck I want to partially replicate Dictionary.app's functionality, I'm trying to create a simple Hangman app that draws words from the built-in Dictionary word bank and uses their definitions as a "hint" eventually.)
After looking at the /Developer/Examples/Automator folder, I thought that these examples would surely provide what I was looking for, but it seems as if all the examples simply create Automator actions; i.e., Automator is launched when these example projects are compiled and run. What I'm looking for is a way to make use of Automator in my project without the user knowing about it (or at least seeing the Automator application launch every time I want a new definition).
Therefore, ...
1) Does anyone know how to make sure of Automator "behind the scenes?"
2) Can the Automator controls in Interface Builder be used without user input?
3 a) Am I going about this in the entirely wrong way (I would prefer not using an online dictionary resource if possible)?
3 b) Should I consider a different method for achieving this effect?
3 c) Should I forget about this altogether?
I'm guessing that one of 3)'s options is what I'll be told to follow. 🙂 In any case, any information about this from someone more knowledgeable than me (i.e., mostly everyone) would be appreciated. 🙂
PowerBook G4, Mac OS X (10.5.2)