Skip to content

Instantly share code, notes, and snippets.

@i-blis
Forked from nolanw/fscript.rb
Created March 6, 2012 14:54
Show Gist options
  • Save i-blis/1986668 to your computer and use it in GitHub Desktop.
Save i-blis/1986668 to your computer and use it in GitHub Desktop.
Inject F-Script into any app on 10.7 Lion
#!/usr/bin/env ruby
FSCRIPT_PATH = "/Library/Frameworks/FScript.framework"
if ARGV.empty?
puts "Usage: #{$0} process_name"
exit
end
GDB = IO.popen("gdb", 'w')
def gdb(cmd)
GDB.puts cmd
GDB.flush
end
gdb "attach #{ARGV[0]}"
gdb "p (char)[[NSBundle bundleWithPath:@\"#{FSCRIPT_PATH}\"] load]"
gdb "p (void)[FScriptMenuItem insertInMainMenu]"
gdb "detach"
gdb "quit"
GDB.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment