I have several questions pertaining to saving/opening files in 10.4 vrs 10.6.
Here's the problem. I use Tex-Edit Plus (TEP) as my primary text editor, I have a lot of scripts that open text files (often HTML files saved from Safari), remove the HTML tags and save them as regular text files. This is done after changing the file name to remove the .html qualifier, leaving the name with no qualifier. i.e. rename file xyz.html to just xyz, then open in TEP, strip the html tags and save. TEP is scriptable, thus facilitating this nicely. On my desktop machine (a Dual 450 PowerPC) I'm running 10.4.11, and the saved document shows up with the TEP icon afterwards.
Using the exact same script on a MacBook running 10.6.4, the icon of the saved document is for TextEdit, not for TEP. If I double click the file saved under 10.4, it opens in TEP. If I double click the file saved on the MacBook, it opens in TextEdit.
If I look at the file properties using a script that has a get info command and displays the properties, the pertinent properties are as follows:
PowerPC running 10.4 MacBook running 10.6
File Kind Tex-Edit Document SimpleText Format File Creator TBB6 TBB6 File Type TEXT TEXT Default application Tex-Edit Plus.app TextEdit.app
Obviously the File Kind and Default Application properties are the more important ones being used to determine the default application that opens the file. BTW, saving a document manually in TEP on the MacBook produces the same results ... this is obviously not just a scripting problem, but a problem in the way 10.4 handles the files vrs 10.6.
Looking at the Finder dictionary, the Kind property of an item is r/o and the Default Application property isn't even shown.
Obviously, at least the Default Application property is changeable via Get Info and changing Open With..., but I don't want to have to manually change each and every file I'm dealing with.
So, how does one, in a script, change the Kind and/or Default Application of a file?
Why does saving the file from TEP (in a script or manually) in 10.4 allow it to be reopened via TEP but when saved by TEP in 10.6 it wants to open via TextEdit?
BTW, I tried: tell app "Finder" to set kind of file theFile to "Tex-Edit Document" it returns an -10006 error: Can't set kind of file ...
TIA,
Jim Brandt
|