Skip to content

Instantly share code, notes, and snippets.

@epoz
Created July 19, 2012 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epoz/3143594 to your computer and use it in GitHub Desktop.
Save epoz/3143594 to your computer and use it in GitHub Desktop.
Sublime Text 2 command to get latest Iconclass Clipboard
[
{ "keys": ["ctrl+i"], "command": "icclipboard" }
]
import sublime_plugin
import urllib
class IcclipboardCommand(sublime_plugin.TextCommand):
def run(self, edit):
txt = urllib.urlopen('http://iconclass.org/clipboard/5155A4/dbtext').read()
for sel in self.view.sel():
self.view.replace(edit, sel, txt)
@epoz
Copy link
Author

epoz commented Jul 19, 2012

Placed in ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/User/ this gives a quick way to insert the latest ICONCLASS codes gathered on my clipboard into the currently selected file.
The next step is how to figure out making it easy for a user to change the clipboard ID to their own. Dialog Box? Editing a JSON file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment