Setting TextEdit Insertion point
Setting TextEdit Insertion point
- Subject: Setting TextEdit Insertion point
- From: "Ken G. Brown" <email@hidden>
- Date: Fri, 13 Jul 2007 21:22:58 -0600
I'm trying to use Applescript to tell TextEdit to open a file, and insert a date/time stamp at the beginning of the file in front of the previous text, followed by two blank lines, then put the insertion point at the beginning of the first blank line so the user can add text at the beginning of a file followed by a blank line. The insertion point always ends up at the end of the file.
This almost does what I want but I do not know how to position the insertion point to where I need it.
set myFile to "MacHD:Testfile.txt"
tell application "TextEdit"
activate
open (file named myFile)
set myTimeStamp to current date
tell document 1
set text 1 to (("-- " & myTimeStamp as string) & " --" & return & return & return) & (text 1)
end tell
end tell
Any tips appreciated...
Thx
Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden