[Pythonmac-SIG] Creator of text files created by Python scripts

savageb savageb@pacbell.net
Thu, 28 Oct 1999 22:38:06 -0700


Chris, you can do a few things.

For one, if you are using the Interpretor and you prefer something other
than 'ttxt' you can change that by using the edit python prefs app (click
the "default startup options" button to find it).

If your python script is usable as a "double-clickable" script (or perhaps
something that you trigger through drag&drop) then you can actually drop the
script applet onto the edit python prefs and that should give you the
ability to change the creator and type codes for just that instance of the
interpretor - you can use this method to change the IDE as well.

Finally if you didn't want to screw up the default settings (like if you
want your scripts to still open in the IDE by default) you can set the
creator and type codes as part of the script using the macfs module (you can
look at mac/scripts/fixfiletypes.py as an example).

Good luck with it,

Bob

Chris Barker <cbarker@jps.net>
> I've found that when I create a new text file in a script that I'm
> running from the IDE, it gets created with creator type "PYTH". If I run
> the same script by dropping it on the Python interpreter, it gets
> created with creator "ttxt", which is not ideal, but is a better option.
> 
> having various text files around that are not python scripts, but have
> creator type "PYTH" is a pain. Can I change this behavioe in the IDE?