Created
May 1, 2013 17:49
-
-
Save mnaberez/5496903 to your computer and use it in GitHub Desktop.
Open a file in 0xED from the command line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
if ARGV[0] | |
filename = File.expand_path(ARGV[0]) | |
abort "File not found: #{filename}" unless File.file?(filename) | |
else | |
abort "Usage: #{__FILE__} <filename>" | |
end | |
`osascript -e 'tell application "0xED" to activate'` | |
cmd = %{tell application "0xED" to open "#{filename}"} | |
`osascript -e '#{cmd}'` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment