I have some trouble with working with plain text files from Windows on my Mac.
Most of the files are working well, but when files are containing some special characters, something else is showing up on the Mac.
OK. I know that this is due to the difference between the ASCII tables of Win & Mac.
In Textedit on the Mac it is possible to open the file with encoding “Western (Windows Latin 1)” and save it again with encoding “Western (Mac OS Roman)”.
This could also be scripted.
But I’m wondering if there is a way to make a droplet or a script which does that, only by using applescript itself, without the help of a texteditor. It would be faster and more stable, I gess.
You can use the Satimage osax:
Thanks jj!
I’m working with Smile and also have the OSAX. And its working very well.
I made a droplet of it:
on open files_
repeat with file_ in files_
set fRef to (open for access file_ with write permission)
write (convert to Mac (read fRef)) to fRef starting at 0
close access fRef
end repeat
end open
Please, show me example script. I have exactly the same task. I can’t force Textedit “Open as” inside AppleScript.
Look at the message you’re replying at.
The code is there, in a reply I did myself. But you have to download Smile (find it at versiontracker.com) to have the needed scriptadditions wich you have to place in your system.
I made a droplet wich is not working with Textedit, just plain scripting.
this is what I always do:
when saving a text file in Windows I save it as “Unicode” instead of “ASCII”
It always works for me though