Google Translator [AppleScript]

Hello Macscripter, in this topic i wanna show you how do an app based in AS language wich can traslate by google translator server. I have just a problem… is possible earn the result of translation in a display dialog? (even using google translator server)

set choice to button returned of (display dialog "Scegli la lingua di traduzione" buttons {"da Italiano a Inglese", "da Inglese a Italiano", "Annulla"} with title "Google Traduttore")
if choice = "da Italiano a Inglese" then
    set _word to text returned of (display dialog "da Italiano a Inglese" default answer "" buttons {"Traduci", "Annulla"} with title "Google Traduttore" default button 1)
    open location "https://translate.google.it/#it/en/" & _word
else if choice = "da Inglese a Italiano" then
    set _word to text returned of (display dialog "da Inglese a Italiano" default answer "" buttons {"Traduci", "Annulla"} with title "Google Traduttore" default button 1)
    open location "https://translate.google.it/#en/it/" & _word
end if

Ps: Why the display dialog haven’t red, yellow and green buttons?

Hi,

as far as I know the google translate API “ to get the results without a browser “ is a paid service

display dialog is a modal dialog, that means it blocks the user interface until the user clicks the Cancel or OK button

Hi LightSoul94,

That’s interesting. Green could mean go, red cancel, and yellow a question. It wouldn’t be too hard to learn how to make an app in Xcode to this. Stephan is an expert on Xcode.

gl,
kel

Come to think of it, there might be a way to do it with AppleScript. I think you could do it with Switches. I need to look back into that.

gl,
kel

I can’t find a lot of my old posts. There was one on switches where you could create an app with buttons. Can’t remember how to find it!

Later,
kel

the google translate API policy has changed meanwhile.

i found the API code, how can i do for insert it in my applescript code?

(i don’t post it because it is very greatest and the site don’t allow me to post it for overchar)