Hello,
Just about everyday I open the same 5 documents in textedit. Everyday (or after every reboot) I have to arrange the windows, which is exactly the same way each time, so they're all displayed a certain way. An applescript for this would prove invaluable. Anyone know a good way to create one that opens, arranges, and resizes 5 .rtf documents in Text Edit? The recording feature of script editor didn't register for Text Edit recordings.
Thanks a ton. I sincerely appreciate your wisdom on this matter! Molto ringraziamento!
Sincerely,
John
Page 1 of 1
Window Applescript for TextEdit
#2
Posted 10 July 2008 - 09:56 AM
johntkucz said:
Hello,
Just about everyday I open the same 5 documents in textedit. Everyday (or after every reboot) I have to arrange the windows, which is exactly the same way each time, so they're all displayed a certain way. An applescript for this would prove invaluable. Anyone know a good way to create one that opens, arranges, and resizes 5 .rtf documents in Text Edit? The recording feature of script editor didn't register for Text Edit recordings.
Thanks a ton. I sincerely appreciate your wisdom on this matter! Molto ringraziamento!
Sincerely,
John
Just about everyday I open the same 5 documents in textedit. Everyday (or after every reboot) I have to arrange the windows, which is exactly the same way each time, so they're all displayed a certain way. An applescript for this would prove invaluable. Anyone know a good way to create one that opens, arranges, and resizes 5 .rtf documents in Text Edit? The recording feature of script editor didn't register for Text Edit recordings.
Thanks a ton. I sincerely appreciate your wisdom on this matter! Molto ringraziamento!
Sincerely,
John
nm, I solved by writing this sweet nugget of applescript code!
--define file variables with POSIX paths
set f1 to "/Users/jk/Desktop/2008IN.rtf"
set f2 to "/Users/jk/Desktop/aIDEAS.rtf"
set f3 to "/Users/jk/Desktop/aTASKS.rtf"
set f4 to "/Users/jk/Desktop/aWF.rtf"
set f5 to "/Users/jk/Reference/passwords.rtf"
--cast the POSIX path variables as scriptable objects
set so1 to POSIX file f1
set so2 to POSIX file f2
set so3 to POSIX file f3
set so4 to POSIX file f4
set so5 to POSIX file f5
--set up width and height variables
set wd to 200
set ht to 500
--open the files
--position & adjust width and height of the files
tell application "TextEdit"
open so1
set bounds of front window to {0, 0, wd, ht}
open so2
set bounds of front window to {wd, 0, wd * 3, ht}
open so3
set bounds of front window to {wd 3, 0, wd 4, ht}
open so4
set bounds of front window to {wd 4, 0, wd 5, ht}
open so5
set bounds of front window to {500, ht 20, wd 800, ht 20 250}
end tell
--hide TextEdit
tell application "System Events" to set visible of process "TextEdit" to false
Thanks to moi, applescript and macworld community!
Page 1 of 1



Sign In
Register
Help


MultiQuote