how to get selected text of any application into safari to google in AppleScript?
here is the sample code what am trying to do:
tell application "System Events" to set selectedText to get selection
tell application "Safari"
open location "https://www.google.com/search?q=" & selectedText
activate
end tell
end tell
In the past, I wrote the script for a similar task. You might also prefer this approach: