Skip to content

Instantly share code, notes, and snippets.

@mnaberez
Created May 1, 2013 17:49
Show Gist options
  • Save mnaberez/5496903 to your computer and use it in GitHub Desktop.
Save mnaberez/5496903 to your computer and use it in GitHub Desktop.
Open a file in 0xED from the command line.
#!/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