I have a simple macro that opens a text file and does a simple paste to the text file for temporary use.
For my use, I would like the text to always be pasted at the very top of the text file. The Applescript below seems to work ok using BBEDIT, however it fails using Apple TextEdit app.
The only problem with TextEdit app - is this line of Apple script fails (after the file is already open):
AS:
select insertion point before first line of front window
Q: - is there some better way to get the cursor to be at the very top of the document before pasting?
Example macro: --- simple macro ---
1- open text file temp.txt
2 - pause 1 sec
3 AS:
tell application "TextEdit"
activate
select insertion point before first line of front window
end tell
I have a variety of AppleScripts to paste text into TextEdit and I’m glad to share some more info on them if you’re interested…however I wholeheartedly believe @kcwhat’s solution is best in this particular case. Because TextEdit is NOT AppleScript friendly.