Created
October 27, 2014 00:28
-
-
Save mattcassinelli/9cbb2184757f61a132ec to your computer and use it in GitHub Desktop.
Sort lines in Drafts 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function generate(s){ | |
| var temp = new Array(); | |
| temp = s.split('\n'); | |
| temp.sort(); | |
| var result = ""; | |
| var i; | |
| for(i=0; i<temp.length; i++) { | |
| result += temp[i] + "\n"; | |
| } | |
| return result; | |
| } | |
| setSelectedText(generate(getSelectedText())) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Script written by Gabe Weatherhead on Macdrifter: http://www.macdrifter.com/2014/10/drafts-4-keyboard-scripts.html#fn:sort
Installation instructions:
To add this to the extra keyboard row in Drafts 4, do this: