Re: Scriptable Text Editor v.1.1
Re: Scriptable Text Editor v.1.1
- Subject: Re: Scriptable Text Editor v.1.1
- From: Rachel Cogent <email@hidden>
- Date: Sun, 16 Sep 2001 02:06:01 +0600
Entity Mr Tea spoke thus:
OK, that is good.
What I want to do is bypass Navigation Services and select a folder.
I tried "open selection" but received an "Apple event" error.
How to?
Rachel
http://www.gnarlodious.com
>
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