Hi,
I created an extension that sends selected text to the Google Translate app, which I downloaded from Google Chrome. The extension works well initially, but after a few hours, when I try to send another text, the extension stops working (it shows only a blank window, with no text to translate) until I delete the cached files from my Home/library directory. Can anybody, please, help me to make the extension work as expected?
Here is the script of the extension I have, with the name of the Google Translator app being ‘GGG’:
#popclip
name: Send to Google Translator app
icon: GGG
applescript: |
set selectedText to "{popclip text}"
-- Copy the selected text to the clipboard
set the clipboard to selectedText
-- Activate the Google Translator app
tell application "GGG"
activate
end tell
-- Simulate the keyboard shortcut to trigger translation (e.g., Command+V)
tell application "System Events"
keystroke "a" using {command down}
Delay 0.5
keystroke "v" using {command down}
end tell
Thank you all for help.
Faris.