c6y Posted January 3, 2014 Share Posted January 3, 2014 Nothing happens when the Hotkey is pressed. Why? Link to comment
Ritashugisha Posted January 4, 2014 Share Posted January 4, 2014 (edited) Nothing happens when the Hotkey is pressed. Why? Instead of using the Alfred browse feature, I would recommend using the run script feature using the following osascript: tell application "Alfred 2" search "define " & "{query}" end tell Edited January 4, 2014 by Ritashugisha Link to comment
c6y Posted January 6, 2014 Author Share Posted January 6, 2014 Thanks @Ritashugisha, unfortunately I couldn't make it work either. Basically I want to create a script that diplays the OSX Thesaurus for the selected text. Trying to get the Dictionary to open is just the first step. Link to comment
Ritashugisha Posted January 7, 2014 Share Posted January 7, 2014 Thanks @Ritashugisha, unfortunately I couldn't make it work either. Basically I want to create a script that diplays the OSX Thesaurus for the selected text. Trying to get the Dictionary to open is just the first step. See if this script will work for you: tell application "Dictionary" activate end tell open location "dict://" & "{query}" tell application "System Events" tell process "Dictionary" tell menu bar 1 tell menu bar item "Search" tell menu "Search" click menu item "Oxford American Writer's Thesaurus" end tell end tell end tell end tell end tell c6y 1 Link to comment
c6y Posted January 8, 2014 Author Share Posted January 8, 2014 Thanks again! Unfortunately it is passing the selected text if set to "pass through to workflow". I've played Here's a link to the workflow as of now. Link to comment
rice.shawn Posted January 12, 2014 Share Posted January 12, 2014 On Mavericks, the "all" tab that is open immediately helps. You could actually just use the URI scheme by running it as a bash script that uses the command: "open dict://{query}" Or you could use the "run command in terminal" action. Either way, it's pretty simple. Link to comment
c6y Posted January 15, 2014 Author Share Posted January 15, 2014 Thanks Shawn! I added a killall Terminal command which quits the Terminal application after opening the dictionary. Not sure it if this is the most elegant way, but it works. open dict://{query} killall Terminal Link to comment
rice.shawn Posted January 16, 2014 Share Posted January 16, 2014 This is funny: I open Alfred2 in order to make a quick example for a more elegant way for you to do this, and I realized that I had been writing something similar several months ago and hadn't finished it. Well, mine was querying the dictionary file itself with a python library, but if I ever finish it, then I'll post that, but, here's is a more elegant solution for you: As you can see, you can run terminal commands just as a "bash script" So, this workflow just consists of a keyword that links to a bash script with only one line: open dict://{query} And that should do it. Link to comment
c6y Posted January 16, 2014 Author Share Posted January 16, 2014 Perfect! Thanks Shawn. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now