I have a problem: I use a Mac and have a Nokia 6600 (S60) phone. I want to archive my short messages from the phone on my Mac. This far, I haven’t found any existing procedure or software for getting the short messages to my Mac. So I rolled my own small script using Python for S60.
Now this is the first time I’ve done anything in Python and the only guide I have had is the Python documentation on the Python site, so don’t expect wonders.
And a warning: you might have to edit the script to suit your needs!
What’s in the package?
The software consists of two Python scripts: sms-export.py, sms-export-to.py and sms-split.py.
sms-export.py is run on your phone. It produces one file, E:/sms-export.txt, from the contents of your inbox. The data is always appended to the file so you will want to rename or remove it after transferring it to your computer. Note that the script only fetches short messages and only from your inbox. The reason for this is that Python for S60 doesn’t provide more.
sms-export-to.py is also run on your phone and it appends to the same file as sms-export.py. It is used to export messages you have sent. This requires some manual work from you so see the instructions.
If you want to, you can split the file sms-export.txt into smaller files that will end up in the SMS subdirectory of this package. There will be one file per short message and each file will have a descriptive name. The modification date of the file is set to the date the message was sent. You do this by running the sms-split.py script.
As the split files have the sender in the file name and I couldn’t get Python to open files with other than ASCII characters in the name (for example Fåglar coded in Mac Roman), the non-ASCII characters in the file name are translated to ASCII abbreviations.
I use the file split feature to import short messages into Journler.
First you need to install Python S60 on your phone. That is not all that trivial. You find the software and instructions on the Nokia Python for S60 site.
The difficult part is figuring out what package you actually should download and install. There are several releases of S60 and you need to get the Python that matches your phone. I found the Wiki useful for this purpose. You don’t need the SDK.
After you have installed Python on your phone, unpack the sms-export package somewhere. In this example, I’m using the desktop. Using Bluetooth, transfer the files sms-export.py and sms-export-to.py to your phone. The phone will get a new message. When you open the message, the Python installer starts automatically.
The installer will ask you how to install the python code. Select “install as Python script”.
Now start Python and select “run script”. You should find sms-export.py in the menu. Run it. When the script is done, it should print how many messages were exported.
Using some kind of file browser on your phone, navigate to the E: drive and send sms-export.txt to your computer. You are done.
If you want to export messages you have sent, not just received, do like this. Move or delete all current messages away from the inbox. Move all sent messages to the inbox. Run sms-export-to.txt. Move or delete the sent messages. Don’t leave them in the inbox. Transfer the file sms-export.txt to your computer.
If you want to split up the big file as one file per message, copy sms-export.txt to the sms-export script directory right beside sms-split.py. Now comes the tricky part. The file is encoded as UTF-8 and it needs to be Mac Roman if you want to continue.
I use SubEthaEdit for the conversion. Now it seems SubEthaEdit has gone commercial with a 30 day trial period. The older version I have is free for home use. There is likely to be some other good text file recoders out there for the Mac that you can use.
After converting the text file and saving it, start the terminal application and change into the sms-export directory. In this example you do like this:
Then you run the splitter like this:
You should get progress printouts as the file is being split. If you get file open errors you might have some non-ASCII characters in the sender name that the split script doesn’t take care of.
Add the missing character to the re.sub part for example like this:
who_file = re.sub("è", "e", who_file)
The usual disclaimer
This software comes with no guarantees of functionality. But it works for me.
Nothing on the roadmap at the moment…