AAArrGH: Copy in Safari, paste to texteditor fails

Select some text in a web page in Safari copy it and pste it to Texteditor…
Should be simple with UI scripting:

Guess what: the text is not even copied! When I go to the Finder and look at the clipboard it contains whatever was there. But NOT my selection!!

Then tried this:

Does not work!!! The copy fails again.
Why on earth is it so difficult to copy some text in one app and paste it into the other???


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

Hi,

I don’t know if this is it but you have the wrong syntax for ui scripting. Something like this:

tell app “Safari” to activate
tell app “System Events”
tell process “Safari”
– do your keystroke thing
end tell
end tell

Note the placement of the ‘activate’ command.

gl,

So I have to activate the app first!
It works!

Thanks gl !