Is there a was I can have Finder (or System Events?) copy the contents of a .txt file to the clipboard? What I want to do is have a bunch of text files that can be read from, and then pasted. So, it’d be something like this:
tell app "System Events"
tell process "Finder"
copy contents of "~/Desktop/message1.txt" to clipboard
keystroke "v" using command down
This is actually for a quote scripting program for IRC. If you have any better ideas for a quote scripting program then having a bunch of text files in a folder (makeshift database), then please share it.
Sorry if I’m thick, but your code snippit doesn’t make it clear what you want to do. FYI, it’s easy to get text to the clipboard from a selection or from a document, and it’s easy to keystroke “v” using {command down} too, but the “paste” has to go somewhere, and the the text being pasted has to come from somewhere and neither of those is clear. Finally, it’s easy to simply read text into an AppleScript and then write it somewhere else, but if other programs are involved, we have to know what they are.
Think through what you want to do a bit more and then ask again.