Jump to content

total neophyte requesting help


Recommended Posts

This is probably more an Automator or Applescript question, but since I know nothing of either and have made a few very simple Alfred workflows (searching websites, basically), I though I'd ask here.

 

  • I have the Oxford English Dictionary v. 4.0 (updated to 4.0.0.3) installed. It is flash-based, and shows the definition of any word copied while it's opened.
  • I'd like to make a workflow with which I can select text, use a hot key, and have the OED window open with the definition. 
  • I assume this would need to first open the OED app, then copy the text, then bring the OED window into "focus" or "on top".

 

Does anyone know how to go about this? Thanks in advance!

Link to comment

It's Flash based? Really? Wow. I thought that the OED would be better than that because most of their other tools are much better.

 

If it's Flashbased, then it's going to be a <insert as many expletives in as many languages as possible here> to get to work reliably. To make it easier do the follow: open "Applescript Editor," then go to "Open Dictionary" and see if the OED application has one. These "dictionaries" are definitions of commands that the application will make available to Applescript. However, it might not have one.

 

Second: open a terminal and get to the directory that contains the app. Then cd into the app (probably: cd AppName.app) at AppName.app/Contents/MacOS. Then type "./AppName" (there should be only one file in that folder, so, run that). I have no idea what will happen at this point. It might open the application. Or it might give you an error on the command line explaining that you're not using it correctly. Regardless, try typing "./AppName -h" and "./AppName --help" to see if those bring up any messages. Sometimes, the applications themselves will be able to be used from the Command Line even though that behavior is not documented at all.

 

Third see what is in the .app folder in general. There might be some files in "AppName.app/Contents/Resources" that are actually database files. They might be sqlite 3 DBs which could be accessed.

 

Fourth, open ~/Library/Application Support/<APPNAME> if the folder exists, and look to see what flies are in there. There might be some database files there.

 

So, the basic approach for the first two is to see if the application provides any way to access the information through the appliation itself. The second is to see where it stores its supporting files. Since the OED is a huge amount of data, it will be stored in some sort of database file in one of those locations. Those database files might be accessible to pull information from.

 

The third way to go about it is called "UI Scripting," which is the very unreliable way because basically you're telling OS X to click the mouse in certain places that should work but might not always do so.

Link to comment

Actually, as a follow up: you do realize that the built in OS X dictionary is the Oxford American Dictionary, right? (It is probably different for other languages). Is there any reason why that one isn't good enough? (I mean, it doesn't have the etymology).

Link to comment

It doesn't really compare to the OED, does it? That thing's huuuge…

 

Can't you just use AppleScript to "press" CMD+C, then bring OED to the front? activate should even work for apps written in Flash.

Edited by deanishe
Link to comment
  • 1 month later...

Guys,

 

Thanks for the help! I've never written a script before—I used Automator to make a workflow:

 

Launch OED

Get Specified Text

Copy to Clipboard (I couldn't figure out how to paste the text, but this works)

 

I so appreciate your help!

 

Will

 

PS: and yes, the OED is one of a kind. It has a fascinating history—there are several good books about it—and it contains even more remarkable history: the first known usage of every single word! That, more than the etymology, is what sets it apart. It does have an exhausting list of obscure words in lost dialects—and thus is not really recommended for Scrabble.

Edited by Will Stewart
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...