Ok, the below script is supposed to be simple and take text from a webpage and paste it into a word doc. I got part of it here and part from Macword article, but i can’t get it to work with Westlaw.com or the “preview” part of this post. it doesn’t copy anything even though when i use the keyboard to copy that works. thoughts?
tell application "Safari"
activate
set selectedText to (do JavaScript "getSelection()" in document 1)
end tell
log selectedText
tell application "Microsoft Word"
tell selection
try
type text text selectedText
end try
end tell
end tell
I’m guessing its something about the way westlaw’s page is built but why can i copy with the keyboard and not the do javascript that works on most pages?