I am looking for an easy solution to copy text from a web page (always in the same location) into to a specific location in Word and print.
tell application “Google Chrome”
activate
tell application “Google Chrome” Get id=“customer-name-first” {not sure how to execute this part}
tell application “System Events” to keystroke “c” using command down
end tell
tell application “Microsoft Word”
activate
tell application “Microsoft Word”
set findRange to find object of selection
tell findRange
execute find find text “xxx” replace with “CLIPBOARD” replace {not sure how to get the clipboard pasted here}
replace all
tell application “System Events” to keystroke “v” using command down
I just tested this Run AppleScript action, which creates a new document and pastes the selected text, works fine
on run {input, parameters}
tell application "Microsoft Word"
launch
activate
make new document at end of documents
tell document 1
set content of text object to input
end tell
end tell
return input
end run
In Automator I selected Service receives selected text in any application
what I am trying to achieve is to copy the text from a browser element
open word find the string of text that is xxx
select it and replace it with the clipboard contents