i’ve a bit trouble with this script snipped here:
--Copies contents of selection
tell application "System Events" to keystroke "c" using command down
in fact, this command isn’t able to put the actual selection (of a text-string) into the clipboard. I got instead the last - not the actual entry of the clipboard- in order to get the actual selection into the board, you have to activate this snippet again.
…because the UI -scripting is for me the last solution which i integrate into a script, (they are soo a rough commands, without elegance)
but in my case i can’t know which application to call. My script -snippet should be useful in every circumstances, like for use with text editors , preview -apps and browsers…
Perhaps i must call (activate) first the front application, and then execute my snipped…
not to give you contra, but this snippet runs in the first paragraph of a longer script, which i activate via keystroke -trigger.(i need not an application)
The option to catch selected text directly with the UI -scripting system is only a “bridge” to shorten obvious passages.
i cannot understand why these snipped will request a repeat- loop. What prevents the snippet, to not catch data already the first time??