Hi,
I’m a total newbie at apple-scripting. Was trying my luck at making a plugin for salling clicker which would take a word from the mobile - search for its meaning using apple’s dictionary and then send the meaning back to the mobile.
Got stuck in trying to get the meaning from the dictionary. I know it can be done using the dictionary service - but how is the question.
Apple support pages say that directory services can be used using the functions mentioned in this page:
For GUI scripting you have to check “Enable access for assistive devices” in System Preferences > Universal Access
otherwise you get a “NSReceiverEvaluationScriptError: 4” error
the Dictionary Services are a great new feature of Mac OS X 10.5 Leopard and it is not very hard to access this excellent framework. All you need is a small Python helper script that I wrote for you to get you started. Just download it to your desktop and then execute the following AppleScript code:
set searchword to "Steve Jobs"
set pyscriptpath to quoted form of (POSIX path of (((path to desktop) as Unicode text) & "dict.py"))
set command to "/usr/bin/python " & pyscriptpath & " " & quoted form of searchword
set dictresult to (do shell script command)
Please note that you need Mac OS X 10.5 Leopard to test this.