I like Pages.app, but don't want to deal with constantly copying and pasting code around. Here is how I do syntax highlighting in Pages.app by pressing a key command. It's based off of [this post on stack exchange](http://apple.stackexchange.com/a/94246). ## install pygments sudo easy_install Pygments ## install github syntax ``` git clone git://github.com/hugomaiavieira/pygments-style-github.git cd pygments-style-github python setup.py install pygmentize -L styles | grep github # should now be listed ``` ## Open "Applescript Editor.app" and turn on the script menubar in preferences ![](http://skitch.sudara.at/General-20140103-211728.jpg) ## Save this script. Adjust pygmentize command if you want to use a specific language, use lang autodetect, etc... ``` try set old to the clipboard as record end try tell application "System Events" to keystroke "c" using command down do shell script "export LC_CTYPE=UTF-8; pbpaste | /usr/local/bin/pygmentize -g -l ruby -f rtf -O style=github | pbcopy" tell application "System Events" to keystroke "v" using command down delay 0.1 try set the clipboard to old end try ``` ## put the script where it belongs 1) Open pages 2) Go to our newly added script icon in menu bar and select "Open Scripts Folder > Open Pages Scripts Folder" 3) Move the script you just saved to that folder. Script now available from the menue while in pages. Select text, then chose the script from the menu. ## Setup the key command If you want the script triggered on a key command, as I did, install [Fastscripts](http://www.red-sweater.com/fastscripts/) — you'll get 10 free keyboard shortcuts to applescripts (you could also use Automator and setup a service) ![](http://skitch.sudara.at/skitched-20140103-222438.jpg)