Re: Scriptable Text Editor v.1.1
Re: Scriptable Text Editor v.1.1
- Subject: Re: Scriptable Text Editor v.1.1
- From: Mr Tea <email@hidden>
- Date: Sat, 15 Sep 2001 17:15:20 +0100
This from Rachel Cogent - dated 15/9/01 1.42 pm:
>
This script converts every file in a folder that are Read-only Readme text
>
into Tex-Edit Plus thus allowing opening in Tex Edit with a click.
>
(Until now, I did this by copying the contents into a new window and naming
>
it the original name)
>
>
tell application "Tex-Edit Plus"
>
activate
>
save windows as string with creator +class TBB6;
>
close windows
>
end tell
You don't need to do any of this, Rachel. Applescript can change the creator
code of any file without assistance from the app you want to map the file
to.
This script, saved as an application/classic applet will change any
SimpleText read-only files dropped on it into TE+ read-only files. If you
want the files to be editable, substitute "TEXT" for "TERO".
on open (fileList)
tell application "Finder"
repeat with theFile in fileList
if creator type of theFile is "ttxt" and file type of theFile is
"ttro" then
set {creator type of theFile, file type of theFile} to
{"TBB6", "TERO"}
end if
end repeat
end tell
end open
You'll need to take out any line wraps if pasting this into your script
editor.
HTH
Mr Tea
--
Brew of the day: Darjeeling
Visit the Tea Room at:
http://homepage.mac.com/mrtea/tearoom.html