I wrote the above Launch Center Pro action over the weekend. I thought it would take 15 minutes, but it took 45, because the encoding was such a challenge.
When I add new list items to an LCP action using the list tag, I sometimes just randomly add an item after the first pipe (|) I can find. Then I notice that the order of my list items has no rhyme or reason to it, so I want to alphabetize it. This is not an easy task, cut-and-pasting in a small text area on an iPhone screen. So I decided to use TextTool to automate the process for me.
Remove the pipes in a sequence like
Apples|Pears|Bananas using the split method.
Use the sort method to alphabetize the list
Add the pipes again between each item, using the join method.
Here is the full LCP action (click on the link in the Twitter embed above to install):
The sort transformation, URL-decoded:
The join transformation, URL-decoded twice:
Notice how, even though this action was URL-encoded twice after the second x-success parameter, the [[output]] had to be encoded yet again before the entire action was URL-encoded twice. I had to add an extra %25 before each double-encoded bracket to make the complete action work.
Resources: TextTool x-callback-url Support page