Jump to content

robots-dreams

Member
  • Posts

    4
  • Joined

  • Last visited

Everything posted by robots-dreams

  1. Thanks. I was able to get it working, thanks to your help and advice. Hotkey Run NSAppleScript on alfred_script(q) -- Google Translate Applescript -- L. Fugitt -- 4/6/2013 -- -- Copies selected text into the translation text box on Google Translate -- tell application "Google Chrome" activate tell application "System Events" to keystroke "c" using command down -- -- Open the Google Translate webpage -- set myTab to make new tab at end of tabs of window 1 set URL of myTab to "http://translate.google.com" -- -- Wait for the webpage to finish loading -- view source of active tab of window 1 delay 3 repeat while loading of active tab of window 1 delay 1 end repeat -- -- Paste the clipboard into Google Translate -- tell application "System Events" to keystroke "v" using command down end tell end alfred_script Post Notification
  2. No problem. I should have been clearer in my description. The problem I've been seeing is probably the paste firing too quickly. I created another Workflow just to paste the clipboard contents, and it works fine. The reason I want to use the Google Translate page rather than just returning the translated contents is to take avantage of the other features on the Google Translate page. For example, you can have the text pronounced, do editing and see the translated changes immediately, see examples of the translated words in use, and save the results to a phrasebook. Thanks for the help. I really appreciate it.
  3. Thanks. That's helpful. There is only one Google Translate workflow that I can find, and it's fairly complex. Basically what I need to do is simple and would apply to any website - not just Google Translate. I just want to open the website URL, and paste the contents of the clipboard. Does that require using additional coding?
  4. I do a lot of research on foreign language websites, usually in Japanese. It isn't always possible to use the Chrome translate plug-in, so I tried creating an Alfred Workflow that would: 1- Trigger on a Hotkey with the Argument "Selection in OS X" and Action "Pass through to workflow" 2- Open URL with http://translate.google.com 3- Copy to Clipboard with "Automatically past to front most app" checked. The workflow opens the Google Translate page, but doesn't paste the clipboard contents. I've also tried it with the Argument "OS X Clipboard contents", making sure that I copied the Japanese text to the clipboard first, but unfortunately that doesn't work either. What am I missing? I know the answer must be so simple I'm totally overlooking it.
×
×
  • Create New...