Permalink
Browse files

added Open Application's Scripting Dictionary

  • Loading branch information...
1 parent b901469 commit ef50b352f750fc73d22d1c9547dda32ee70c50c0 @kch committed Sep 25, 2010
Showing with 14 additions and 0 deletions.
  1. +14 −0 Open Application's Scripting Dictionary.rb
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+# encoding: UTF-8
+require 'appscript'
+
+#############################################################################
+# Open the frontmost application's Scripting Dictionary on AppleScript Editor
+#############################################################################
+
+processes = Appscript::app("System Events").processes
+is_frontmost_condition = Appscript.its.frontmost.eq(true)
+frontmost_application = processes[is_frontmost_condition].first
+frontmost_application_path = frontmost_application.application_file.get(:result_type => :file_ref).path
+
+system('open', '-a', 'AppleScript Editor', frontmost_application_path)

0 comments on commit ef50b35

Please sign in to comment.