Skip to content

Instantly share code, notes, and snippets.

@kotas
Created September 15, 2010 15:15
Show Gist options
  • Save kotas/580871 to your computer and use it in GitHub Desktop.
Save kotas/580871 to your computer and use it in GitHub Desktop.
CotEditor をシェルから起動するの
#!/usr/bin/python
#
# Shell command for CotEditor
#
import sys
import os
import os.path
files = [os.path.abspath(s) for s in sys.argv[1:]]
script = """
tell application "CotEditor"
activate
%s
end tell
""" % "\n".join([' open "%s"' % path for path in files])
ps = os.popen("osascript", "w")
ps.write(script)
ps.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment