segphault Posted December 21, 2013 Share Posted December 21, 2013 I built a workflow that applies syntax highlighting to the text in the clipboard. By default, it performs RTF-based highlighting and stores the output in the clipboard as rich text so that the colorized content can be pasted into applications like Keynote and Evernote. The workflow uses a script filter to let you select the programming language. It's totally self contained, using the Pygments library which is bundled in the workflow. You can easily customize the script to change the output format (to HTML, for example) or pick a different Pygments color scheme. You can download the workflow here: http://seg.phault.net/alfred/Highlighter.alfredworkflow I wrote a blog post about it here: http://blog.phault.net/2013/12/slide-deck-syntax-highlighting-made-easy-with-alfred/ This is an example of a Keynote slide where I used the workflow for highlighting: alexcory and twinpeaks 2 Link to comment
_oho Posted December 26, 2013 Share Posted December 26, 2013 Hello Segphaul, this look really cool. unfortunately, I can't make it to work Do I need some python library install to make it work ? Like installing pygments? Am I the only one for whom this does not work out of the box ? O. Link to comment
raguay.customct Posted December 27, 2013 Share Posted December 27, 2013 It does not work for me either. From command line, AppKit is not a standard included library. You need to install it. Link to comment
segphault Posted January 9, 2014 Author Share Posted January 9, 2014 Hmm. I'm not sure why it wouldn't just work... it has worked out of the box on all three of my computers. :-/ The AppKit Python module comes from PyObjC, which I think has been standard on OS X since 10.5. Pygments is bundled with the workflow, so that shouldn't be a problem either. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now