xfslove / alfred-google-translate

Alfred 3 workflow - translate with google api💵🚫
MIT License
618 stars 65 forks source link

Action items appear not to be working. #47

Closed okayjeffrey closed 4 years ago

okayjeffrey commented 5 years ago

In alfred when on the 1st or 2nd item I can not copy, lookup or do any of the action commands you outlined. It will only speak the text.

Note: I over wrote this to just spit out the text translation in the index.js file by using the toText variable instead of the toArg

This output isn't very interesting or informative but hope it helps.

Output when hitting [Enter]

[12:13:38.638] Google Translate[Script Filter] Queuing argument 'testing' [12:13:47.558] Google Translate[Script Filter] Queuing argument 'testing' [12:13:48.454] Google Translate[Script Filter] Script with argv 'testing' finished [12:13:48.457] Google Translate[Script Filter] { "items": [ { "title": "testing", "subtitle": "Phonetic: ", "quicklookurl": "https://translate.google.com/#view=home&op=translate&sl=en&tl=de&text=testing", "arg": "/var/folders/fk/5c3q4j6911lg5993psshss_w0000gn/T/9f8fd0c5-7761-4f06-a8a8-55beda163502.mp3", "text": { "copy": "testing", "largetype": "testing" }, "icon": { "path": "tts.png" } }, { "title": "testen", "subtitle": "Phonetic: ", "quicklookurl": "https://translate.google.com/#view=home&op=translate&sl=de&tl=en&text=testen", "arg": "/var/folders/fk/5c3q4j6911lg5993psshss_w0000gn/T/9d9066c1-e2b6-497f-8727-36b8b38a066c.mp3", "text": { "copy": "testen", "largetype": "testen" }, "icon": { "path": "tts.png" } }, { "title": "Definition[verb]: take measures to check the quality, performance, or reliability of (something), especially before putting it into widespread use or practice.", "subtitle": "Example: Excavations of the ditch have recovered antlers that were left behind and after their age was tested it was revealed that the first henge was built over 50 centuries ago.", "text": { "copy": "take measures to check the quality, performance, or reliability of (something), especially before putting it into widespread use or practice.", "largetype": "Definition: take measures to check the quality, performance, or reliability of (something), especially before putting it into widespread use or practice.\n\nExample: Excavations of the ditch have recovered antlers that were left behind and after their age was tested it was revealed that the first henge was built over 50 centuries ago." } }, { "title": "Translation[noun]: Testen", "subtitle": "Frequency: 0.1850 Synonyms: testing", "text": { "copy": "Testen", "largetype": "Translation: Testen\n\nSynonyms: testing" } }, { "title": "Translation[noun]: Prüfung", "subtitle": "Frequency: 0.1122 Synonyms: examination,test,audit,testing,exam,check", "text": { "copy": "Prüfung", "largetype": "Translation: Prüfung\n\nSynonyms: examination,test,audit,testing,exam,check" } }, { "title": "Translation[noun]: Erprobung", "subtitle": "Frequency: 0.0175 Synonyms: testing", "text": { "copy": "Erprobung", "largetype": "Translation: Erprobung\n\nSynonyms: testing" } } ] } [12:13:51.220] Google Translate[Script Filter] Processing complete [12:13:51.239] Google Translate[Script Filter] Passing output '/var/folders/fk/5c3q4j6911lg5993psshss_w0000gn/T/9d9066c1-e2b6-497f-8727-36b8b38a066c.mp3' to Copy to Clipboard

Output if I hit [CMD] + [Enter]

[12:15:47.015] Google Translate[Script Filter] Queuing argument 'testing' [12:15:49.606] Google Translate[Script Filter] Script with argv 'testing' finished [12:15:49.610] Google Translate[Script Filter] { "items": [ { "title": "testing", "subtitle": "Phonetic: ", "quicklookurl": "https://translate.google.com/#view=home&op=translate&sl=en&tl=de&text=testing", "arg": "/var/folders/fk/5c3q4j6911lg5993psshss_w0000gn/T/d525b4e8-5794-4ccd-b28f-f396a4ab11a3.mp3", "text": { "copy": "testing", "largetype": "testing" }, "icon": { "path": "tts.png" } }, { "title": "testen", "subtitle": "Phonetic: ", "quicklookurl": "https://translate.google.com/#view=home&op=translate&sl=de&tl=en&text=testen", "arg": "/var/folders/fk/5c3q4j6911lg5993psshss_w0000gn/T/e9cee485-d4f2-4c13-9a0a-ba1f08645dd9.mp3", "text": { "copy": "testen", "largetype": "testen" }, "icon": { "path": "tts.png" } }, { "title": "Definition[verb]: take measures to check the quality, performance, or reliability of (something), especially before putting it into widespread use or practice.", "subtitle": "Example: Excavations of the ditch have recovered antlers that were left behind and after their age was tested it was revealed that the first henge was built over 50 centuries ago.", "text": { "copy": "take measures to check the quality, performance, or reliability of (something), especially before putting it into widespread use or practice.", "largetype": "Definition: take measures to check the quality, performance, or reliability of (something), especially before putting it into widespread use or practice.\n\nExample: Excavations of the ditch have recovered antlers that were left behind and after their age was tested it was revealed that the first henge was built over 50 centuries ago." } }, { "title": "Translation[noun]: Testen", "subtitle": "Frequency: 0.1850 Synonyms: testing", "text": { "copy": "Testen", "largetype": "Translation: Testen\n\nSynonyms: testing" } }, { "title": "Translation[noun]: Prüfung", "subtitle": "Frequency: 0.1122 Synonyms: examination,test,audit,testing,exam,check", "text": { "copy": "Prüfung", "largetype": "Translation: Prüfung\n\nSynonyms: examination,test,audit,testing,exam,check" } }, { "title": "Translation[noun]: Erprobung", "subtitle": "Frequency: 0.0175 Synonyms: testing", "text": { "copy": "Erprobung", "largetype": "Translation: Erprobung\n\nSynonyms: testing" } } ] }

xfslove commented 5 years ago

hi, @okayjeffrey . I watched the output you posted, it looks right .

you can see the snippet:

"quicklookurl": "https://translate.google.com/#view=home&op=translate&sl=de&tl=en&text=testen",
"arg": "/var/folders/fk/5c3q4j6911lg5993psshss_w0000gn/T/9d9066c1-e2b6-497f-8727-36b8b38a066c.mp3",
"text": {
"copy": "testing",
"largetype": "testing"
}

those three properties are the workflow used.

arg : STRING (recommended)

The argument which is passed through the workflow to the connected output action.

text : OBJECT (optional)

The text element defines the text the user will get when copying the selected result row with ⌘C or displaying large type with ⌘L.

quicklookurl : STRING (optional)

A Quick Look URL which will be visible if the user uses the Quick Look feature within Alfred (tapping shift, or cmd+y).

copy from Script Filter JSON Format.

the arg value will passed to the bash script(the voice) action by tapping enter, and the text, quicklookurl used the default hotkey.

as you mention, speak the text works, i think it means there is no problem with the outputs. but, you can not copy the item or do other actions like largetype and quicklook, its weird.

im not sure if its caused by your alfred not support the text and quicklookurl properties, or caused by the hotkey conflict.

could you check the alfred version and the hotkey please?

xfslove commented 4 years ago

hi @okayjeffrey , if you got the correct result as you expected. i'll close this issue.

xfslove commented 4 years ago

if you have any questions, you could reopen it or raise a new issue.