Lars Schneider Lars Schneider - 1 month ago 5x
AppleScript Question

"Sort Lines in Selection" for Xcode 4

I like Textmate's "Sort Lines in Selection" feature a lot. Is there something similar for Xcode 4? If not, what would be the best way to integrate such a feature (a plugin, Applescript, ...)?


You can do this with Automator in Lion.

  • Start Automator and select "Service"
  • Find and drag "Run Shell Script" into the workflow panel
  • Select "Output replaces selected text"
  • Type sort -f into the "Run Shell Script" textfield
  • Save

Now you can sort lines in any textfield. Select some text and right-click or Control click and select the service you just created.

enter image description here