Working with currently-selected text
Working with currently-selected text
- Subject: Working with currently-selected text
- From: "Mark J. Reed" <email@hidden>
- Date: Wed, 11 May 2005 09:49:12 -0400
I'm trying to write a script to muck with the current text selection irrespective of the application the text is selected in.
Since I don't mind nuking the contents of the clipboard, I thought this would work:
tell application "System Events"
keystroke "c" using command down -- copy
set theSelection to the clipboard
muckWith(theSelection)
set the clipboard to theSelection
keystroke "v" using command down -- paste
end tell
but this gets me the old clipboard contents since I'm grabbing the
clipboard before the app has a chance to receive and act on the
command-C.
Is there a reliable way to wait for the clipboard to be updated by the copy command before proceeding?
--
Mark J. Reed <
email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden