Export Text Assist learned words and shortcuts [webOS 2.x] (homebrew) | webOS Nation
 
 

Export Text Assist learned words and shortcuts [webOS 2.x] (homebrew)

by Adam Marks Mon, 27 Jun 2011 9:08 pm EDT

This tip is only for devices running webOS 2.0 and higher

While there currently is no method to backup and restore the entries you have added to the Text Assist app for either "Learned Words" or "Text Shortcuts," rcmarvin in our forums has provided a way to at least view your entries using a command line command. Add in a few tweaks and you have some code that you can use to create a text file on your device so you can back up your manual Text Assist entries. Using the command line (either by using an app like Terminus on the device or using the recently re-added Linux Commandline feature in webOS Quick Install), enter the following commands:

Export Learned Words:

luna-send -n 1 palm://com.palm.smartKey/listUserWords '{"offset": 0, "limit": 1000}' > /media/internal/learned.txt

This will create a file called "learned.txt" on the USB drive on your device, with a list of your learned words. The text file will contain something that looks like this (with pre2, pre3, precentral, touchpad, and veer as the learned words):

{ "returnValue": true, "words": [ "pre2", "pre3", "precentral", "touchpad", "veer" ] }

Export Text Shortcuts:

luna-send -n 1 palm://com.palm.smartKey/listAutoReplace '{"offset": 0, "limit": 1000}' > /media/internal/shortcuts.txt

This will create a file called "shortcuts.txt" on the USB drive on your device, with a list of your shortcuts. It will look something like this:

{ "returnValue": true, "entries": [ { "shortcut": "i", "sub": "I" }, { "shortcut": "ill", "sub": "I'll" }, { "shortcut": "im", "sub": "I'm" }, { "shortcut": "pc", "sub": "precentral" }, { "shortcut": "r", "sub": "are" }, { "shortcut": "u", "sub": "you" } ] }

Note that the "limit" of 1000 entries in the code above is an arbitrary limit. If you need more, just update the code.

Manually add entries to Text Assist

rcmarvin also provided a method to add "learned words" or "text shortcuts" to your Text Assist app via command line. Using the code

luna-send -n 1 palm://com.palm.smartKey/addUserWord '{"word": "PreCentral"}'

or

luna-send -n 1 palm://com.palm.smartKey/addAutoReplace '{"shortcut": "pc", "substitution": "PreCentral"}'

you can add the word "PreCentral" to your Text Assist learned words or shortcuts. Therefore, to replace your Text Assist entries after a webOS Doctor or device swap, you can always create a script to restore multiple words at once.

Hopefully, HP will add Text Assist words to the Palm Profile backup in the future, but at least this provides you a method to manually backup your entries. In the meantime look for a script to be added to the Save/Restore app shortly (it's already in the testing feeds) that will automatically create and backup the text files for you, although not restore them.

Thanks to rcmarvin in the forums for the code

 

5
Your rating: None Average: 5 (1 vote)