document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. # Posted at http://n8henrie.com/2013/02/quickly-import-pythonista-scripts-via-textexpander-or-bookmarklet
  2. # Script Name: Import Pythonista Script from Bookmarklet
  3.  
  4. # I got help from here: http://twolivesleft.com/Codea/Talk/discussion/1652/what-others-do%3A-pythonista/p1
  5. # I got help from here: http://www.macdrifter.com/2012/09/pythonista-trick-url-to-markdown.html
  6. # I got help from here: http://www.macstories.net/tutorials/from-instapaper-and-pythonista-to-dropbox-and-evernote-as-pdf/
  7.  
  8. import sys
  9. import urllib2
  10. import editor
  11. import os
  12.  
  13. url = sys.argv[1]
  14. scriptName = os.path.basename(url)
  15. contents = urllib2.urlopen(url).read()
  16. editor.make_new_file(scriptName[:-3], contents)
');