{"id":1479,"date":"2006-11-07T21:58:07","date_gmt":"2006-11-07T18:58:07","guid":{"rendered":"http:\/\/www.lokala.org\/sms-exportpy-for-s60\/"},"modified":"2007-05-15T18:28:44","modified_gmt":"2007-05-15T15:28:44","slug":"sms-exportpy-for-s60","status":"publish","type":"page","link":"http:\/\/www.lokala.org\/?page_id=1479","title":{"rendered":"sms-export.py for S60"},"content":{"rendered":"<p><b>What&#8217;s this?<\/b><\/p>\n<p>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&#8217;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.<\/p>\n<p>Now this is the first time I&#8217;ve done anything in Python and the only guide I have had is the Python documentation on the Python site, so don&#8217;t expect wonders.<\/p>\n<p>And a warning: you might have to edit the script to suit your needs!<\/p>\n<p><b>The software<\/b><\/p>\n<p>Version 0.2: <a href=\"\/src\/sms-export-0.2.tar.gz\">sms-export-0.2.tar.gz<\/a>. The second release. Click the link to download.<br \/>\nVersion 0.1: <a href=\"\/src\/sms-export-0.1.tar.gz\">sms-export-0.1.tar.gz<\/a>. The initial release. Click the link to download.<\/p>\n<p><b>What&#8217;s in the package?<\/b><\/p>\n<p>The software consists of two Python scripts: <b>sms-export.py<\/b>, <b>sms-export-to.py<\/b> and <b>sms-split.py<\/b>.<\/p>\n<p><b>sms-export.py<\/b> is run on your phone. It produces one file, <b>E:\/sms-export.txt<\/b>, 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&#8217;t provide more.<\/p>\n<p><b>sms-export-to.py<\/b> 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.<\/p>\n<p>If you want to, you can split the file <b>sms-export.txt<\/b> 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 <b>sms-split.py<\/b> script.<\/p>\n<p>As the split files have the sender in the file name and I couldn&#8217;t get Python to open files with other than ASCII characters in the name (for example F\u00e5glar coded in Mac Roman), the non-ASCII characters in the file name are translated to ASCII abbreviations.<\/p>\n<p>I use the file split feature to import short messages into <a href=\"http:\/\/journler.phildow.net\/\">Journler<\/a>.<\/p>\n<p><b>Quick instructions<\/b><\/p>\n<p>First you need to install Python S60 on your phone. That is not all that trivial. You find the software and instructions on <a href=\"http:\/\/opensource.nokia.com\/projects\/pythonfors60\/index.html\">the Nokia Python for S60<\/a> site.<\/p>\n<p>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 <a href=\"http:\/\/wiki.opensource.nokia.com\/projects\/Installing_PyS60\">Wiki<\/a> useful for this purpose. You don&#8217;t need the SDK.<\/p>\n<p>After you have installed Python on your phone, unpack the sms-export package somewhere. In this example, I&#8217;m using the desktop. Using Bluetooth, transfer the files <b>sms-export.py<\/b> and <b>sms-export-to.py<\/b> to your phone. The phone will get a new message. When you open the message, the Python installer starts automatically.<\/p>\n<p>The installer will ask you how to install the python code. Select &#8220;install as Python script&#8221;.<\/p>\n<p>Now start Python and select &#8220;run script&#8221;. You should find <b>sms-export.py<\/b> in the menu. Run it. When the script is done, it should print how many messages were exported.<\/p>\n<p>Using some kind of file browser on your phone, navigate to the <b>E:<\/b> drive and send <b>sms-export.txt<\/b> to your computer. You are done.<\/p>\n<p>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 <b>sms-export-to.txt<\/b>. Move or delete the sent messages. Don&#8217;t leave them in the inbox. Transfer the file <b>sms-export.txt<\/b> to your computer.<\/p>\n<p>If you want to split up the big file as one file per message, copy <b>sms-export.txt<\/b> to the sms-export script directory right beside <b>sms-split.py<\/b>. Now comes the tricky part. The file is encoded as UTF-8 and it needs to be Mac Roman if you want to continue. <\/p>\n<p>I use <a href=\"http:\/\/www.codingmonkeys.de\/subethaedit\/\">SubEthaEdit<\/a> 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.<\/p>\n<p>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:<\/p>\n<p><tt>    cd Desktop\/sms-export-0.1<\/tt><\/p>\n<p>Then you run the splitter like this:<\/p>\n<p><tt>    .\/sms-split.py<\/tt><\/p>\n<p>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&#8217;t take care of.<\/p>\n<p>Add the missing character to the <b>re.sub<\/b> part for example like this:<\/p>\n<p><tt>    who_file = re.sub(\"\u00e8\", \"e\", who_file)<\/tt><\/p>\n<p><b>The usual disclaimer<\/b><\/p>\n<p>This software comes with no guarantees of functionality. But it works for me.<\/p>\n<p><b>Roadmap<\/b><\/p>\n<p>Nothing on the roadmap at the moment&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What&#8217;s this? 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&#8217;t found any existing procedure or software for getting the short messages to my Mac. So I rolled my own small script &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.lokala.org\/?page_id=1479\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;sms-export.py for S60&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-1479","page","type-page","status-publish","hentry"],"jetpack_shortlink":"https:\/\/wp.me\/P3k9Yf-nR","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.lokala.org\/index.php?rest_route=\/wp\/v2\/pages\/1479","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.lokala.org\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.lokala.org\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.lokala.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.lokala.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1479"}],"version-history":[{"count":0,"href":"http:\/\/www.lokala.org\/index.php?rest_route=\/wp\/v2\/pages\/1479\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.lokala.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}