G’day all
I’m trying to paste a number of copied Mail attachments into the end of a TextEdit document, in Yosemite, without success.
Used to be that key code 125 using {command down} worked, but now THAT key code is intercepted by the Yosemite Finder, and seems to open every item of the selected Finder window. Also, keystroke ASCII 19 doesn’t work.
Does anyone know of a way to place the insertion character at the end of a Yosemite TextEdit app, please?
I’d like to continue using TextEdit because my printing requirements for my app are simple, it has a low footprint, opens VERY fast, and I can close and reopen it to stop any memory leaks, because my app runs 24/7/365.
I’m also using it to modify saved Mail rtf documents, because lousy new Mail won’t save it’s documents with Attachments; the menu item is present, but greyed out. I open the rtf, paste in copied Attachments at the end, and a pop up sheet automatically opens and offers to save as an rtfd file. You can’t actually click button 1 of sheet 1 of window 1 but that code is ignored, and I exit the setting loop.
When saving the document, it’s saved as an rtfd.
I CAN use the following script to place the cursor at the end, but…
1. It needs the rtf to be opened well before I open the folder of attachments, and copy them ready for pasting, &
2. It’s so darn cumbersome.
NOTE: while composing this email, I had a brainwave; what if I send ‘down arrows’ to the rtf? I tried the following, and it works, PROVIDED I send at least a blank character to the speech utility; without it, the down arrows don’t work!!!!
Any takers on WHY, please, or advice? Is there an easier way?
Regards
Santa
tell application "TextEdit" activate tell document 1 activate set paragraphCount to (paragraph count) as number say " " as text — < What does this do? tell application "System Events" to tell process "TextEdit" repeat paragraphCount times try # Down arrow key code 125 end try end repeat end tell end tell end tell
tell application "System Events" to tell application process "TextEdit" delay 0.1 click menu item "Select All" of menu 1 of menu bar item "Edit" of menu bar 1 delay 0.1 click menu item "Copy" of menu 1 of menu bar item "Edit" of menu bar 1 delay 0.2 keystroke "v" using command down end tell
|