Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Release 0.3.0

  • Loading branch information...
commit 010656f301426513881dd092b78c962706e24a16 1 parent 3856463
@RobertLowe authored
View
15 CHANGES
@@ -1 +1,14 @@
-None yet!
+v 0.3.0
+====
+* Changed how blocks are passed and received
+* Slight changes the API
+* New example scripts
+* Added a bunch of commands, see `examples/` directory for details
+* Added `open` command
+* Added `link` command
+* Added `terminal` command (best used with one terminal window and/or visor)
+* Added `menu` command
+
+v 0.2.5
+====
+ * Initial release
View
142 README.md
@@ -6,50 +6,42 @@ A simple DSL to create a systembar menu with macruby in OSX
![](http://i.imgur.com/yQBEE.png)
1. `gem install mynu`
-2. `macruby examples/hello-mynu.rb`
-
-
-An example of abusing `open [-a]`
-
-`macruby examples/workflow.rb`
-
-
-Or if your feeling bohemian:
-
-`macruby examples/queen.rb`
+2. `macruby examples/dsl.rb`
+Usage example:
+`macruby examples/dsl.rb`
require 'rubygems'
require 'mynu'
mynu = Mynu.new
- mynu.item "Hello World!" do |menu|
+ mynu.menu "Hello World!" do |menu|
puts "Inside menu setup!"
menu.title = "Good Bye World!"
- menu.item "Option 1" do |sub_menu|
- sub_menu.execute do
+ menu.item "Option 1" do |item|
+ item.execute do
puts "Execution block"
- sub_menu.title = "Dynamically changed!"
+ item.title = "Dynamically changed!"
end
end
- menu.item "Option 2" do |sub_menu|
- sub_menu.item "Option 2a" do
+ menu.menu "Option 2" do |menu|
+ menu.item "Option 2a" do
puts "Option 2a clicked!"
end
- sub_menu.item "Option 2b" do
+ menu.item "Option 2b" do
puts "Option 2b clicked!"
end
- sub_menu.execute do
- puts "Execution block and items"
- sub_menu.title = "Dynamically changed!"
+ menu.execute do
+ puts "Menu item clicked!"
+ menu.title = "Dynamically changed!"
end
end
- capture_menu_item = menu.item "Disabled" do |sub_menu|
- sub_menu.disabled
+ capture_menu_item = menu.item "Disabled" do |item|
+ item.disabled
end
- menu.item "Enable `Disabled`" do |sub_menu|
- sub_menu.execute do
+ menu.item "Enable `Disabled`" do |item|
+ item.execute do
capture_menu_item.enabled
capture_menu_item.execute do
capture_menu_item.title = "Disabled (Again)!"
@@ -67,65 +59,74 @@ Or if your feeling bohemian:
====
- require 'rubygems'
- require 'mynu'
+A workflow example:
+`macruby examples/workflow.rb`
mynu = Mynu.new
- mynu.item "Applications" do |applications|
- applications.item "Terminal" do
- # TODO: AppleScript a tab, this does nothing if terminal is open
- `open -a /Applications/Utilities/Terminal.app`
- end
+ mynu.menu "Applications" do |applications|
+ applications.app "TextEdit", "/Applications/Utilities/Terminal.app"
end
- mynu.item "Project" do |project|
- project.item "Live" do
- `open http://example.com`
- end
- project.item "Staging" do
- `open http://user:pass@staging.example.com`
- end
- project.item "Development" do
- `open http://example.dev`
- end
- project.item "Repos" do |repos|
- repos.item "Example" do
- `open ~/example`
- end
- repos.item "Resources" do
- `open ~/example-resources`
- end
+ mynu.menu "Project" do |project|
+ project.link "Live", "http://example.com"
+ project.link "Staging", "http://user:pass@staging.example.com"
+ project.link "Development", "http://example.dev"
+ project.menu "Repos" do |repos|
+ repos.open "Example", "~/example"
+ repos.open "Resources", "~/example-resources"
end
end
- mynu.items << NSMenuItem.separatorItem
+ mynu.separator
- mynu.item "Development" do |development|
- development.item "Rails" do |development_mynu|
- development_mynu.item "Github" do
- `open http://github.com/rails/rails`
- end
- development_mynu.item "Repo" do
- `open ~/workspace/rails`
- end
+ mynu.menu "Development" do |development|
+ development.menu "Rails" do |rails|
+ rails.link "Github", "http://github.com/rails/rails"
+ rails.open "Repo", "~/workspace/rails"
end
end
- mynu.items << NSMenuItem.separatorItem
+ mynu.separator
+ mynu.open "Downloads", "~/Downloads"
+ mynu.separator
+ mynu.open "Desktop", "~/Desktop"
+ mynu.separator
+
+ mynu.run
- mynu.item "Downloads" do
- `open ~/Downloads`
- end
- mynu.items << NSMenuItem.separatorItem
+A terminal example (best used with Visor and one terminal window!):
+`macruby examples/terminal.rb`
- desktop = mynu.item "Desktop" do
- `open ~/Desktop`
+ require 'rubygems'
+ require 'mynu'
+
+ mynu = Mynu.new
+
+ #############################################################
+ # Warning!
+ #
+ # This makes the assumation you use Visor and only manage
+ # one terminal window. Otherwise tabs will only be created
+ # in your first/primary terminal window.
+ #
+ # You can get Visor at: http://visor.binaryage.com/
+ #
+ #############################################################
+
+ # Normal usage will return to the frontmost app at execution
+ mynu.terminal "Echo & Disable Item", "echo hello" do
+ disabled
end
- mynu.items << NSMenuItem.separatorItem
+ mynu.terminal "Echo & Exit", "echo hello", :exit => true do
+ disabled
+ end
+ mynu.terminal "Keeps focus on Terminal Tab", "echo hello", :focus => true do
+ disabled
+ end
mynu.run
@@ -133,11 +134,10 @@ Or if your feeling bohemian:
Todo
=====
- * Lots
- * Reloading
- * Crash Handling
+ * Improved API (done!)
+ * Reloading?
+ * Crash Handling?
* FileMenuItem
- * Improved API
- * Simple Dialogs?
+ * Simple Dialogs
# Copyright (C) 2011 by Robert Lowe <rob[!]iblargz.com> - MIT
View
39 examples/apps.rb
@@ -0,0 +1,39 @@
+# Copyright (C) 2011 by Robert Lowe <rob[!]iblargz.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+require 'rubygems'
+require 'mynu'
+
+mynu = Mynu.new
+
+mynu.app "TextEdit", "/Applications/TextEdit.app"
+
+mynu.app "TextEdit", "/Applications/TextEdit.app" do
+ p self # BlockMenuItem
+ setTitle "TextEdit - Clicked"
+end
+
+mynu.link "TextEdit & Disable", "/Applications/TextEdit.app" do |item|
+ p item # BlockMenuItem
+ item.setTitle "TextEdit Disabled!"
+ item.disabled
+end
+
+mynu.run
View
30 examples/hello-mynu.rb → examples/dsl.rb
@@ -23,32 +23,34 @@
mynu = Mynu.new
-mynu.item "Hello World!" do |menu|
+mynu.menu "Hello World!" do |menu|
puts "Inside menu setup!"
menu.title = "Good Bye World!"
- menu.item "Option 1" do |sub_menu|
- sub_menu.execute do
+ menu.item "Option 1" do |item|
+ item.execute do
puts "Execution block"
- sub_menu.title = "Dynamically changed!"
+ item.title = "Dynamically changed!"
end
end
- menu.item "Option 2" do |sub_menu|
- sub_menu.item "Option 2a" do
+ menu.menu "Option 2" do |menu|
+ menu.item "Option 2a" do
puts "Option 2a clicked!"
end
- sub_menu.item "Option 2b" do
+ menu.item "Option 2b" do
puts "Option 2b clicked!"
end
- sub_menu.execute do
- puts "Execution block and items"
- sub_menu.title = "Dynamically changed!"
+ menu.execute do |menu|
+ puts "Menu clicked!"
+ menu.title = "Dynamically changed!"
end
end
- capture_menu_item = menu.item "Disabled" do |sub_menu|
- sub_menu.disabled
+ capture_menu_item = menu.item "Disabled" do |item|
+ item.disabled
end
- menu.item "Enable `Disabled`" do |sub_menu|
- sub_menu.execute do
+ capture_menu_item.disabled
+ menu.item "Enable `Disabled`" do |item|
+ capture_menu_item.enabled
+ item.execute do
capture_menu_item.enabled
capture_menu_item.execute do
capture_menu_item.title = "Disabled (Again)!"
View
39 examples/links.rb
@@ -0,0 +1,39 @@
+# Copyright (C) 2011 by Robert Lowe <rob[!]iblargz.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+require 'rubygems'
+require 'mynu'
+
+mynu = Mynu.new
+
+mynu.link "Google", "http://google.com"
+
+mynu.link "Google", "http://google.com" do
+ p self # BlockMenuItem
+ setTitle "New"
+end
+
+mynu.link "Google (Will disable)", "http://google.com" do |item|
+ p item # BlockMenuItem
+ item.setTitle "Disabled!"
+ item.disabled
+end
+
+mynu.run
View
51 examples/menu.rb
@@ -0,0 +1,51 @@
+# Copyright (C) 2011 by Robert Lowe <rob[!]iblargz.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+require 'rubygems'
+require 'mynu'
+
+mynu = Mynu.new
+
+mynu.menu "Menu 1" do
+ self.link "Google", "http://google.com" do
+ p self # BlockMenuItem
+ setTitle "New"
+ end
+ self.link "Google (Will disable)", "http://google.com" do |item|
+ p item # BlockMenuItem
+ item.setTitle "Disabled!"
+ item.disabled
+ end
+end
+
+mynu.menu "Menu 2" do |menu|
+ menu.link "Google", "http://google.com" do
+ p self # BlockMenuItem
+ setTitle "New"
+ end
+ menu.link "Google (Will disable)", "http://google.com" do |item|
+ p item # BlockMenuItem
+ item.setTitle "Disabled!"
+ item.disabled
+ end
+end
+
+
+mynu.run
View
44 examples/open.rb
@@ -0,0 +1,44 @@
+# Copyright (C) 2011 by Robert Lowe <rob[!]iblargz.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+require 'rubygems'
+require 'mynu'
+
+mynu = Mynu.new
+
+mynu.open "Home", "~/"
+
+mynu.item "Downloads", "~/Downloads" do
+ p self # BlockMenuItem
+ setTitle "Changed!"
+end
+
+mynu.open "Downloads", "~/Downloads" do
+ p self # BlockMenuItem
+ setTitle "Changed!"
+end
+
+mynu.open "Pictures (Will Disable)", "~/Pictures" do |item|
+ p item # BlockMenuItem
+ item.setTitle "Disabled!"
+ item.disabled
+end
+
+mynu.run
View
50 examples/terminal.rb
@@ -0,0 +1,50 @@
+# Copyright (C) 2011 by Robert Lowe <rob[!]iblargz.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+require 'rubygems'
+require 'mynu'
+
+mynu = Mynu.new
+
+#############################################################
+# Warning!
+#
+# This makes the assumation you use Visor and only manage
+# one terminal window. Otherwise tabs will only be created
+# in your first/primary terminal window.
+#
+# You can get Visor at: http://visor.binaryage.com/
+#
+#############################################################
+
+# Normal usage will return to the frontmost app at execution
+mynu.terminal "Echo & Disable Item", "echo hello" do
+ disabled
+end
+
+mynu.terminal "Echo & Exit", "echo hello", :exit => true do
+ disabled
+end
+
+mynu.terminal "Keeps focus on Terminal Tab", "echo hello", :focus => true do
+ disabled
+end
+
+mynu.run
View
65 examples/workflow.rb
@@ -23,59 +23,34 @@
mynu = Mynu.new
-mynu.item "Applications" do |applications|
- applications.item "Terminal" do
- # TODO: AppleScript a tab, this does nothing if terminal is open
- `open -a /Applications/Utilities/Terminal.app`
- end
+mynu.menu "Applications" do |applications|
+ applications.app "TextEdit", "/Applications/Utilities/Terminal.app"
end
-mynu.item "Project" do |project|
- project.item "Live" do
- `open http://example.com`
- end
- project.item "Staging" do
- `open http://user:pass@staging.example.com`
- end
- project.item "Development" do
- `open http://example.dev`
- end
- project.item "Repos" do |repos|
- repos.item "Example" do
- `open ~/example`
- end
- repos.item "Resources" do
- `open ~/example-resources`
- end
+mynu.menu "Project" do |project|
+ project.terminal "Working Directory", "~/example"
+ project.link "Live", "http://example.com"
+ project.link "Staging", "http://user:pass@staging.example.com"
+ project.link "Development", "http://example.dev"
+ project.menu "Repos" do |repos|
+ repos.open "Example", "~/example"
+ repos.open "Resources", "~/example-resources"
end
end
-mynu.items << NSMenuItem.separatorItem
+mynu.separator
-mynu.item "Development" do |development|
- development.item "Rails" do |development_mynu|
- development_mynu.item "Github" do
- `open http://github.com/rails/rails`
- end
- development_mynu.item "Repo" do
- `open ~/workspace/rails`
- end
+mynu.menu "Development" do |development|
+ development.menu "Rails" do |rails|
+ rails.link "Github", "http://github.com/rails/rails"
+ rails.open "Repo", "~/workspace/rails"
end
end
-mynu.items << NSMenuItem.separatorItem
-
-mynu.item "Downloads" do
- `open ~/Downloads`
-end
-
-mynu.items << NSMenuItem.separatorItem
-
-desktop = mynu.item "Desktop" do
- `open ~/Desktop`
-end
-
-mynu.items << NSMenuItem.separatorItem
-
+mynu.separator
+mynu.open "Downloads", "~/Downloads"
+mynu.separator
+mynu.open "Desktop", "~/Desktop"
+mynu.separator
mynu.run
View
40 lib/mynu.rb
@@ -12,37 +12,41 @@ class Mynu
autoload :Menu, 'mynu/menu' # wrapping NSMenu
autoload :Dsl, 'mynu/dsl' # dsl modules
- include Dsl::Block
+ autoload :Support, 'mynu/support'
- attr_accessor :app # the sharedApplication
- attr_accessor :status_item # the new bar icon
- attr_accessor :menu # menu container
- attr_accessor :items # root items
+ attr_accessor :__app # the sharedApplication
+ attr_accessor :__status_item # the new bar icon
+ attr_accessor :__menu # menu container
+
+ include Dsl::Block # menu, app, open, terminal on items
+ alias_method :link, :open
+
+ attr_accessor :items
# Prepare the application
def initialize(icon = nil, menu_title = 'Mynu')
- @app = NSApplication.sharedApplication
+ @__app = NSApplication.sharedApplication
icon = File.join(File.dirname(__FILE__), '..', 'lib') + '/mynu/assets/logo.png' if icon.nil?
- @status_item = status_bar.statusItemWithLength(NSVariableStatusItemLength)
- @status_item.setImage NSImage.new.initWithContentsOfFile(icon)
+ @__status_item = status_bar.statusItemWithLength(NSVariableStatusItemLength)
+ @__status_item.setImage NSImage.new.initWithContentsOfFile(icon)
+
+ @__menu = Menu.new
+ @__menu.initWithTitle menu_title
+ @__menu.setAutoenablesItems false
- @menu = Menu.new
- @menu.initWithTitle menu_title
- @menu.setAutoenablesItems false
-
@items = []
end
def run
- @status_item.setMenu loadMenu
- @app.run
+ @__status_item.setMenu loadMenu
+ @__app.run
end
def quit(sender)
puts "Quitting :: Mynu"
- @app.terminate(self)
+ @__app.terminate(self)
end
protected
@@ -53,16 +57,16 @@ def status_bar
def loadMenu
@items.each do |item|
- @menu.addItem item
+ @__menu.addItem item
end
quit = Menu::MenuItem.new
quit.title = 'Quit'
quit.action = 'quit:'
quit.target = self
- @menu.addItem quit
+ @__menu.addItem quit
- @menu
+ @__menu
end
end
View
6 lib/mynu/dsl.rb
@@ -2,4 +2,10 @@ class Mynu
module Dsl
autoload :Block, 'mynu/dsl/block'
end
+
+ class Receivable < Proc
+ def call(sender)
+ super(sender)
+ end
+ end
end
View
94 lib/mynu/dsl/block.rb
@@ -1,16 +1,96 @@
class Mynu
module Dsl
module Block
+ def separator
+ @items << NSMenuItem.separatorItem
+ end
+
+ def app(title, app, &block)
+ block = Proc.new {} unless block_given?
+ add_item(
+ title,
+ item_block(block) { `open -a #{app}` }
+ )
+ end
+
+ def open(title, path, &block)
+ block = Proc.new {} unless block_given?
+ add_item(
+ title,
+ item_block(block) { `open #{path}` }
+ )
+ end
+
+ def terminal(title, command, options={}, &block)
+ block = Proc.new {} unless block_given?
+ add_item(
+ title,
+ item_block(block) {
+ terminal = Mynu::Support::Terminal.new
+ terminal.create_tab(command, options)
+ }
+ )
+ end
+
def item(title, &block)
- if block_given?
- item = Menu::BlockMenuItem.new(title, block)
- @items << item
- item
- else
- raise
- end
+ block = Proc.new {} unless block_given?
+ add_item(
+ title,
+ item_block(block) { }
+ )
end
+
+ def menu(title, &block)
+ raise "Block must be provided for a menu" unless block_given?
+ add_item(
+ title,
+ item_block(Proc.new {}) {}
+ ) {
+ case block.arity
+ when 0
+ self.instance_eval(&block)
+ when 1
+ block.call(self)
+ else
+ raise
+ end
+
+ if self.items.length > 0
+ menu = Menu.new
+ menu.setAutoenablesItems false
+
+ self.setSubmenu menu
+
+ self.items.each do |item|
+ menu.addItem item
+ end
+ end
+ }
+ end
+
+ def add_item(title, runtime_block, &block)
+ item = Menu::BlockMenuItem.new(title, runtime_block)
+ item.instance_eval(&block) if block_given?
+ @items << item
+ item
+ end
+
+ def item_block(original_block, &block)
+ Receivable.new { |sender|
+ block.call(sender) if block
+ case original_block.arity
+ when 0
+ sender.instance_eval(&original_block)
+ when 1
+ original_block.call(sender)
+ else
+ raise
+ end
+ }
+ end
+
end
end
end
+
View
36 lib/mynu/menu/block_menu_item.rb
@@ -2,40 +2,22 @@ class Mynu
module Menu
class BlockMenuItem < MenuItem
include Dsl::Block
-
- def execute(&block)
- self.action = 'call:'
- self.target = block
- end
+ alias_method :link, :open
def initialize(title, block)
- super # thanks for asking
+ super
self.title = title
- case block.arity
- when 0
- # regular item
- self.action = 'call:'
- self.target = block
- when 1
- block.call(self)
-
- if @items.length > 0
- menu = Menu.new
- menu.setAutoenablesItems false
-
- self.setSubmenu menu
+ self.action = 'call:'
+ self.target = block
+ end
- @items.each do |item|
- menu.addItem item
- end
- end
- else
- raise
- end
+ def execute(&block)
+ self.action = 'call:'
+ self.target = item_block(block){}
end
-
+
def disabled
self.setEnabled(false)
self.isEnabled
View
9 lib/mynu/support.rb
@@ -0,0 +1,9 @@
+framework 'Foundation'
+framework 'ScriptingBridge'
+
+class Mynu
+ module Support
+ autoload :System, 'mynu/support/system'
+ autoload :Terminal, 'mynu/support/terminal'
+ end
+end
View
484 lib/mynu/support/bridgesupport/SystemEvents.bridgesupport
@@ -0,0 +1,484 @@
+<?xml version='1.0'?>
+<!DOCTYPE signatures SYSTEM "file://localhost/System/Library/DTDs/BridgeSupport.dtd">
+<signatures version='0.9'>
+<enum name='SystemEventsAppeBlue' value='1651275109'/>
+<enum name='SystemEventsAppeGraphite' value='1735550580'/>
+<enum name='SystemEventsDhacAskWhatToDo' value='1684562291'/>
+<enum name='SystemEventsDhacIgnore' value='1684564327'/>
+<enum name='SystemEventsDhacOpenApplication' value='1684562288'/>
+<enum name='SystemEventsDhacRunAScript' value='1684566643'/>
+<enum name='SystemEventsDpefGenie' value='1734700649'/>
+<enum name='SystemEventsDpefScale' value='1935892844'/>
+<enum name='SystemEventsDplsBottom' value='1651471476'/>
+<enum name='SystemEventsDplsLeft' value='1818584692'/>
+<enum name='SystemEventsDplsRight' value='1919510376'/>
+<enum name='SystemEventsEMdsCommandDown' value='1264807268'/>
+<enum name='SystemEventsEMdsControlDown' value='1264809068'/>
+<enum name='SystemEventsEMdsOptionDown' value='1265594484'/>
+<enum name='SystemEventsEMdsShiftDown' value='1265854068'/>
+<enum name='SystemEventsEMkyCommand' value='1698917732'/>
+<enum name='SystemEventsEMkyControl' value='1698918004'/>
+<enum name='SystemEventsEMkyOption' value='1699704948'/>
+<enum name='SystemEventsEMkyShift' value='1699964532'/>
+<enum name='SystemEventsEdfmApplePhotoFormat' value='1684435048'/>
+<enum name='SystemEventsEdfmAppleShareFormat' value='1684431219'/>
+<enum name='SystemEventsEdfmAudioFormat' value='1684431221'/>
+<enum name='SystemEventsEdfmHighSierraFormat' value='1684433011'/>
+<enum name='SystemEventsEdfmISO9660Format' value='1684420918'/>
+<enum name='SystemEventsEdfmMSDOSFormat' value='1684434291'/>
+<enum name='SystemEventsEdfmMacOSExtendedFormat' value='1684432939'/>
+<enum name='SystemEventsEdfmMacOSFormat' value='1684432998'/>
+<enum name='SystemEventsEdfmNFSFormat' value='1684434534'/>
+<enum name='SystemEventsEdfmProDOSFormat' value='1684435058'/>
+<enum name='SystemEventsEdfmQuickTakeFormat' value='1684435316'/>
+<enum name='SystemEventsEdfmUDFFormat' value='1684436324'/>
+<enum name='SystemEventsEdfmUFSFormat' value='1684436326'/>
+<enum name='SystemEventsEdfmUnknownFormat' value='1684415524'/>
+<enum name='SystemEventsEdfmWebDAVFormat' value='1684436836'/>
+<enum name='SystemEventsEnumDetailed' value='1819763828'/>
+<enum name='SystemEventsEnumStandard' value='1819767668'/>
+<enum name='SystemEventsEpacAllWindows' value='1634495607'/>
+<enum name='SystemEventsEpacApplicationWindows' value='1634758775'/>
+<enum name='SystemEventsEpacDashboard' value='1684108136'/>
+<enum name='SystemEventsEpacDisableScreenSaver' value='1684632419'/>
+<enum name='SystemEventsEpacNone' value='1852796517'/>
+<enum name='SystemEventsEpacShowDesktop' value='1684370283'/>
+<enum name='SystemEventsEpacShowSpaces' value='1936745331'/>
+<enum name='SystemEventsEpacSleepDisplay' value='1684632435'/>
+<enum name='SystemEventsEpacStartScreenSaver' value='1937006962'/>
+<enum name='SystemEventsEpfkF1' value='1177643897'/>
+<enum name='SystemEventsEpfkF10' value='1177628779'/>
+<enum name='SystemEventsEpfkF11' value='1177629035'/>
+<enum name='SystemEventsEpfkF12' value='1177629291'/>
+<enum name='SystemEventsEpfkF13' value='1177629547'/>
+<enum name='SystemEventsEpfkF14' value='1177629803'/>
+<enum name='SystemEventsEpfkF15' value='1177630059'/>
+<enum name='SystemEventsEpfkF16' value='1177630315'/>
+<enum name='SystemEventsEpfkF17' value='1177630571'/>
+<enum name='SystemEventsEpfkF18' value='1177630827'/>
+<enum name='SystemEventsEpfkF19' value='1177631083'/>
+<enum name='SystemEventsEpfkF2' value='1177709433'/>
+<enum name='SystemEventsEpfkF3' value='1177774969'/>
+<enum name='SystemEventsEpfkF4' value='1177840505'/>
+<enum name='SystemEventsEpfkF5' value='1177906041'/>
+<enum name='SystemEventsEpfkF6' value='1177971577'/>
+<enum name='SystemEventsEpfkF7' value='1178037113'/>
+<enum name='SystemEventsEpfkF8' value='1178102649'/>
+<enum name='SystemEventsEpfkF9' value='1178168185'/>
+<enum name='SystemEventsEpfkLeftCommand' value='1281584484'/>
+<enum name='SystemEventsEpfkLeftControl' value='1281586284'/>
+<enum name='SystemEventsEpfkLeftOption' value='1282371700'/>
+<enum name='SystemEventsEpfkLeftShift' value='1282631796'/>
+<enum name='SystemEventsEpfkNone' value='1852796517'/>
+<enum name='SystemEventsEpfkRightCommand' value='1382247780'/>
+<enum name='SystemEventsEpfkRightControl' value='1382249580'/>
+<enum name='SystemEventsEpfkRightOption' value='1383034996'/>
+<enum name='SystemEventsEpfkRightShift' value='1383295092'/>
+<enum name='SystemEventsEpfkSecondaryFunctionKey' value='1397123961'/>
+<enum name='SystemEventsEpmdCommand' value='1668113517'/>
+<enum name='SystemEventsEpmdControl' value='1668574317'/>
+<enum name='SystemEventsEpmdNone' value='1852796517'/>
+<enum name='SystemEventsEpmdOption' value='1869640813'/>
+<enum name='SystemEventsEpmdShift' value='1936225389'/>
+<enum name='SystemEventsFtssAutomatic' value='1635087469'/>
+<enum name='SystemEventsFtssLight' value='1818850405'/>
+<enum name='SystemEventsFtssMedium' value='1835361385'/>
+<enum name='SystemEventsFtssStandard' value='1937010276'/>
+<enum name='SystemEventsFtssStrong' value='1937011303'/>
+<enum name='SystemEventsHicoBlue' value='1651275109'/>
+<enum name='SystemEventsHicoGold' value='1735355492'/>
+<enum name='SystemEventsHicoGraphite' value='1735550580'/>
+<enum name='SystemEventsHicoGreen' value='1735550318'/>
+<enum name='SystemEventsHicoOrange' value='1869770343'/>
+<enum name='SystemEventsHicoPurple' value='1886548076'/>
+<enum name='SystemEventsHicoRed' value='1919247392'/>
+<enum name='SystemEventsHicoSilver' value='1936488050'/>
+<enum name='SystemEventsMvszCurrent' value='1668641652'/>
+<enum name='SystemEventsMvszDouble' value='1685026146'/>
+<enum name='SystemEventsMvszHalf' value='1751215206'/>
+<enum name='SystemEventsMvszNormal' value='1852797549'/>
+<enum name='SystemEventsMvszScreen' value='1718187123'/>
+<enum name='SystemEventsPrmdNormal' value='1852797549'/>
+<enum name='SystemEventsPrmdSlideShow' value='1886221171'/>
+<enum name='SystemEventsSavoAsk' value='1634954016'/>
+<enum name='SystemEventsSavoNo' value='1852776480'/>
+<enum name='SystemEventsSavoYes' value='2036691744'/>
+<enum name='SystemEventsSclbJumpToHere' value='1953458290'/>
+<enum name='SystemEventsSclbJumpToNextPage' value='1853386855'/>
+<enum name='SystemEventsSclpTogether' value='1952937064'/>
+<enum name='SystemEventsSclpTogetherAtTopAndBottom' value='1952937058'/>
+<enum name='SystemEventsSclpTopAndBottom' value='1953522292'/>
+<class name='SystemEventsAlias'>
+<method selector='printPrintDialog:withProperties:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setStationery:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='stationery'>
+<retval type='B'/>
+</method>
+</class>
+<class name='SystemEventsAppearancePreferencesObject'>
+<method selector='doubleClickMinimizes'>
+<retval type='B'/>
+</method>
+<method selector='fontSmoothing'>
+<retval type='B'/>
+</method>
+<method selector='setDoubleClickMinimizes:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setFontSmoothing:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setSmoothScrolling:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='smoothScrolling'>
+<retval type='B'/>
+</method>
+</class>
+<class name='SystemEventsApplication'>
+<method selector='UIElementsEnabled'>
+<retval type='B'/>
+</method>
+<method selector='folderActionsEnabled'>
+<retval type='B'/>
+</method>
+<method selector='frontmost'>
+<retval type='B'/>
+</method>
+<method selector='scriptMenuEnabled'>
+<retval type='B'/>
+</method>
+<method selector='setFolderActionsEnabled:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setUIElementsEnabled:'>
+<arg type='B' index='0'/>
+</method>
+</class>
+<class name='SystemEventsAttribute'>
+<method selector='settable'>
+<retval type='B'/>
+</method>
+</class>
+<class name='SystemEventsConfiguration'>
+<method selector='connected'>
+<retval type='B'/>
+</method>
+</class>
+<class name='SystemEventsDesktop'>
+<method selector='randomOrder'>
+<retval type='B'/>
+</method>
+<method selector='setRandomOrder:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setTranslucentMenuBar:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='translucentMenuBar'>
+<retval type='B'/>
+</method>
+</class>
+<class name='SystemEventsDisk'>
+<method selector='ejectable'>
+<retval type='B'/>
+</method>
+<method selector='ignorePrivileges'>
+<retval type='B'/>
+</method>
+<method selector='localVolume'>
+<retval type='B'/>
+</method>
+<method selector='setIgnorePrivileges:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='startup'>
+<retval type='B'/>
+</method>
+</class>
+<class name='SystemEventsDiskItem'>
+<method selector='busyStatus'>
+<retval type='B'/>
+</method>
+<method selector='packageFolder'>
+<retval type='B'/>
+</method>
+<method selector='setVisible:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='visible'>
+<retval type='B'/>
+</method>
+</class>
+<class name='SystemEventsDockPreferencesObject'>
+<method selector='animate'>
+<retval type='B'/>
+</method>
+<method selector='autohide'>
+<retval type='B'/>
+</method>
+<method selector='magnification'>
+<retval type='B'/>
+</method>
+<method selector='setAnimate:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setAutohide:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setMagnification:'>
+<arg type='B' index='0'/>
+</method>
+</class>
+<class name='SystemEventsDocument'>
+<method selector='modified'>
+<retval type='B'/>
+</method>
+</class>
+<class name='SystemEventsFile'>
+<method selector='setStationery:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='stationery'>
+<retval type='B'/>
+</method>
+</class>
+<class name='SystemEventsFolderAction'>
+<method selector='enabled'>
+<retval type='B'/>
+</method>
+<method selector='setEnabled:'>
+<arg type='B' index='0'/>
+</method>
+</class>
+<class name='SystemEventsInterface'>
+<method selector='automatic'>
+<retval type='B'/>
+</method>
+<method selector='setAutomatic:'>
+<arg type='B' index='0'/>
+</method>
+</class>
+<class name='SystemEventsItem'>
+<method selector='exists'>
+<retval type='B'/>
+</method>
+</class>
+<class name='SystemEventsLoginItem'>
+<method selector='hidden'>
+<retval type='B'/>
+</method>
+<method selector='setHidden:'>
+<arg type='B' index='0'/>
+</method>
+</class>
+<class name='SystemEventsPrintSettings'>
+<method selector='collating'>
+<retval type='B'/>
+</method>
+<method selector='exists'>
+<retval type='B'/>
+</method>
+<method selector='setCollating:'>
+<arg type='B' index='0'/>
+</method>
+</class>
+<class name='SystemEventsProcess'>
+<method selector='Classic'>
+<retval type='B'/>
+</method>
+<method selector='acceptsHighLevelEvents'>
+<retval type='B'/>
+</method>
+<method selector='acceptsRemoteEvents'>
+<retval type='B'/>
+</method>
+<method selector='backgroundOnly'>
+<retval type='B'/>
+</method>
+<method selector='frontmost'>
+<retval type='B'/>
+</method>
+<method selector='hasScriptingTerminology'>
+<retval type='B'/>
+</method>
+<method selector='setFrontmost:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setVisible:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='visible'>
+<retval type='B'/>
+</method>
+</class>
+<class name='SystemEventsQuickTimeData'>
+<method selector='autoPlay'>
+<retval type='B'/>
+</method>
+<method selector='autoPresent'>
+<retval type='B'/>
+</method>
+<method selector='autoQuitWhenDone'>
+<retval type='B'/>
+</method>
+<method selector='looping'>
+<retval type='B'/>
+</method>
+<method selector='storedStream'>
+<retval type='B'/>
+</method>
+</class>
+<class name='SystemEventsScreenSaverPreferencesObject'>
+<method selector='mainScreenOnly'>
+<retval type='B'/>
+</method>
+<method selector='running'>
+<retval type='B'/>
+</method>
+<method selector='setMainScreenOnly:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setShowClock:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='showClock'>
+<retval type='B'/>
+</method>
+</class>
+<class name='SystemEventsScript'>
+<method selector='enabled'>
+<retval type='B'/>
+</method>
+<method selector='setEnabled:'>
+<arg type='B' index='0'/>
+</method>
+</class>
+<class name='SystemEventsSecurityPreferencesObject'>
+<method selector='automaticLogin'>
+<retval type='B'/>
+</method>
+<method selector='logOutWhenInactive'>
+<retval type='B'/>
+</method>
+<method selector='requirePasswordToUnlock'>
+<retval type='B'/>
+</method>
+<method selector='requirePasswordToWake'>
+<retval type='B'/>
+</method>
+<method selector='secureVirtualMemory'>
+<retval type='B'/>
+</method>
+<method selector='setAutomaticLogin:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setLogOutWhenInactive:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setRequirePasswordToUnlock:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setRequirePasswordToWake:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setSecureVirtualMemory:'>
+<arg type='B' index='0'/>
+</method>
+</class>
+<class name='SystemEventsService'>
+<method selector='active'>
+<retval type='B'/>
+</method>
+</class>
+<class name='SystemEventsSpacesPreferencesObject'>
+<method selector='setSpacesEnabled:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='spacesEnabled'>
+<retval type='B'/>
+</method>
+</class>
+<class name='SystemEventsTrack'>
+<method selector='audioCharacteristic'>
+<retval type='B'/>
+</method>
+<method selector='enabled'>
+<retval type='B'/>
+</method>
+<method selector='highQuality'>
+<retval type='B'/>
+</method>
+<method selector='setEnabled:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setHighQuality:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='visualCharacteristic'>
+<retval type='B'/>
+</method>
+</class>
+<class name='SystemEventsUIElement'>
+<method selector='enabled'>
+<retval type='B'/>
+</method>
+<method selector='focused'>
+<retval type='B'/>
+</method>
+<method selector='selected'>
+<retval type='B'/>
+</method>
+<method selector='setFocused:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setSelected:'>
+<arg type='B' index='0'/>
+</method>
+</class>
+<class name='SystemEventsWindow'>
+<method selector='closeable'>
+<retval type='B'/>
+</method>
+<method selector='floating'>
+<retval type='B'/>
+</method>
+<method selector='miniaturizable'>
+<retval type='B'/>
+</method>
+<method selector='miniaturized'>
+<retval type='B'/>
+</method>
+<method selector='modal'>
+<retval type='B'/>
+</method>
+<method selector='resizable'>
+<retval type='B'/>
+</method>
+<method selector='setMiniaturized:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setVisible:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setZoomed:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='titled'>
+<retval type='B'/>
+</method>
+<method selector='visible'>
+<retval type='B'/>
+</method>
+<method selector='zoomable'>
+<retval type='B'/>
+</method>
+<method selector='zoomed'>
+<retval type='B'/>
+</method>
+</class>
+</signatures>
View
1,690 lib/mynu/support/bridgesupport/SystemEvents.h
@@ -0,0 +1,1690 @@
+/*
+ * SystemEvents.h
+ */
+
+#import <AppKit/AppKit.h>
+#import <ScriptingBridge/ScriptingBridge.h>
+
+
+@class SystemEventsItem, SystemEventsApplication, SystemEventsColor, SystemEventsDocument, SystemEventsWindow, SystemEventsAttributeRun, SystemEventsCharacter, SystemEventsParagraph, SystemEventsText, SystemEventsAttachment, SystemEventsWord, SystemEventsDockPreferencesObject, SystemEventsCDAndDVDPreferencesObject, SystemEventsInsertionPreference, SystemEventsUser, SystemEventsLoginItem, SystemEventsScreenSaver, SystemEventsScreenSaverPreferencesObject, SystemEventsDiskItem, SystemEventsAlias, SystemEventsDisk, SystemEventsDomain, SystemEventsClassicDomainObject, SystemEventsFile, SystemEventsFilePackage, SystemEventsFolder, SystemEventsLocalDomainObject, SystemEventsNetworkDomainObject, SystemEventsSystemDomainObject, SystemEventsUserDomainObject, SystemEventsFolderAction, SystemEventsScript, SystemEventsAction, SystemEventsAttribute, SystemEventsUIElement, SystemEventsBrowser, SystemEventsBusyIndicator, SystemEventsButton, SystemEventsCheckbox, SystemEventsColorWell, SystemEventsColumn, SystemEventsComboBox, SystemEventsDrawer, SystemEventsGroup, SystemEventsGrowArea, SystemEventsImage, SystemEventsIncrementor, SystemEventsList, SystemEventsMenu, SystemEventsMenuBar, SystemEventsMenuBarItem, SystemEventsMenuButton, SystemEventsMenuItem, SystemEventsOutline, SystemEventsPopUpButton, SystemEventsProcess, SystemEventsApplicationProcess, SystemEventsDeskAccessoryProcess, SystemEventsProgressIndicator, SystemEventsRadioButton, SystemEventsRadioGroup, SystemEventsRelevanceIndicator, SystemEventsRow, SystemEventsScrollArea, SystemEventsScrollBar, SystemEventsSheet, SystemEventsSlider, SystemEventsSplitter, SystemEventsSplitterGroup, SystemEventsStaticText, SystemEventsTabGroup, SystemEventsTable, SystemEventsTextArea, SystemEventsTextField, SystemEventsToolBar, SystemEventsValueIndicator, SystemEventsPropertyListFile, SystemEventsPropertyListItem, SystemEventsAnnotation, SystemEventsQuickTimeData, SystemEventsAudioData, SystemEventsMovieData, SystemEventsQuickTimeFile, SystemEventsAudioFile, SystemEventsMovieFile, SystemEventsTrack, SystemEventsXMLAttribute, SystemEventsXMLData, SystemEventsXMLElement, SystemEventsXMLFile, SystemEventsExposePreferencesObject, SystemEventsScreenCorner, SystemEventsShortcut, SystemEventsSpacesPreferencesObject, SystemEventsSpacesShortcut, SystemEventsConfiguration, SystemEventsInterface, SystemEventsLocation, SystemEventsNetworkPreferencesObject, SystemEventsService, SystemEventsDesktop, SystemEventsAppearancePreferencesObject, SystemEventsSecurityPreferencesObject, SystemEventsPrintSettings;
+
+enum SystemEventsSavo {
+ SystemEventsSavoAsk = 'ask ' /* Ask the user whether or not to save the file. */,
+ SystemEventsSavoNo = 'no ' /* Do not save the file. */,
+ SystemEventsSavoYes = 'yes ' /* Save the file. */
+};
+typedef enum SystemEventsSavo SystemEventsSavo;
+
+enum SystemEventsDpls {
+ SystemEventsDplsBottom = 'bott' /* bottom */,
+ SystemEventsDplsLeft = 'left' /* left */,
+ SystemEventsDplsRight = 'righ' /* right */
+};
+typedef enum SystemEventsDpls SystemEventsDpls;
+
+enum SystemEventsDpef {
+ SystemEventsDpefGenie = 'geni' /* genie */,
+ SystemEventsDpefScale = 'scal' /* scale */
+};
+typedef enum SystemEventsDpef SystemEventsDpef;
+
+enum SystemEventsDhac {
+ SystemEventsDhacAskWhatToDo = 'dhas' /* ask what to do */,
+ SystemEventsDhacIgnore = 'dhig' /* ignore */,
+ SystemEventsDhacOpenApplication = 'dhap' /* open application */,
+ SystemEventsDhacRunAScript = 'dhrs' /* run a script */
+};
+typedef enum SystemEventsDhac SystemEventsDhac;
+
+enum SystemEventsEdfm {
+ SystemEventsEdfmApplePhotoFormat = 'dfph' /* Apple Photo format */,
+ SystemEventsEdfmAppleShareFormat = 'dfas' /* AppleShare format */,
+ SystemEventsEdfmAudioFormat = 'dfau' /* audio format */,
+ SystemEventsEdfmHighSierraFormat = 'dfhs' /* High Sierra format */,
+ SystemEventsEdfmISO9660Format = 'df96' /* ISO 9660 format */,
+ SystemEventsEdfmMacOSExtendedFormat = 'dfh+' /* Mac OS Extended format */,
+ SystemEventsEdfmMacOSFormat = 'dfhf' /* Mac OS format */,
+ SystemEventsEdfmMSDOSFormat = 'dfms' /* MSDOS format */,
+ SystemEventsEdfmNFSFormat = 'dfnf' /* NFS format */,
+ SystemEventsEdfmProDOSFormat = 'dfpr' /* ProDOS format */,
+ SystemEventsEdfmQuickTakeFormat = 'dfqt' /* QuickTake format */,
+ SystemEventsEdfmUDFFormat = 'dfud' /* UDF format */,
+ SystemEventsEdfmUFSFormat = 'dfuf' /* UFS format */,
+ SystemEventsEdfmUnknownFormat = 'df$$' /* unknown format */,
+ SystemEventsEdfmWebDAVFormat = 'dfwd' /* WebDAV format */
+};
+typedef enum SystemEventsEdfm SystemEventsEdfm;
+
+enum SystemEventsEMds {
+ SystemEventsEMdsCommandDown = 'Kcmd' /* command down */,
+ SystemEventsEMdsControlDown = 'Kctl' /* control down */,
+ SystemEventsEMdsOptionDown = 'Kopt' /* option down */,
+ SystemEventsEMdsShiftDown = 'Ksft' /* shift down */
+};
+typedef enum SystemEventsEMds SystemEventsEMds;
+
+enum SystemEventsEMky {
+ SystemEventsEMkyCommand = 'eCmd' /* command */,
+ SystemEventsEMkyControl = 'eCnt' /* control */,
+ SystemEventsEMkyOption = 'eOpt' /* option */,
+ SystemEventsEMkyShift = 'eSft' /* shift */
+};
+typedef enum SystemEventsEMky SystemEventsEMky;
+
+enum SystemEventsPrmd {
+ SystemEventsPrmdNormal = 'norm' /* normal */,
+ SystemEventsPrmdSlideShow = 'pmss' /* slide show */
+};
+typedef enum SystemEventsPrmd SystemEventsPrmd;
+
+enum SystemEventsMvsz {
+ SystemEventsMvszCurrent = 'cust' /* current */,
+ SystemEventsMvszDouble = 'doub' /* double */,
+ SystemEventsMvszHalf = 'half' /* half */,
+ SystemEventsMvszNormal = 'norm' /* normal */,
+ SystemEventsMvszScreen = 'fits' /* screen */
+};
+typedef enum SystemEventsMvsz SystemEventsMvsz;
+
+enum SystemEventsEpac {
+ SystemEventsEpacAllWindows = 'allw' /* all windows */,
+ SystemEventsEpacApplicationWindows = 'appw' /* application windows */,
+ SystemEventsEpacDashboard = 'dash' /* dashboard */,
+ SystemEventsEpacDisableScreenSaver = 'disc' /* disable screen saver */,
+ SystemEventsEpacNone = 'none' /* none */,
+ SystemEventsEpacShowDesktop = 'desk' /* show desktop */,
+ SystemEventsEpacShowSpaces = 'spcs' /* show spaces */,
+ SystemEventsEpacSleepDisplay = 'diss' /* sleep display */,
+ SystemEventsEpacStartScreenSaver = 'star' /* start screen saver */
+};
+typedef enum SystemEventsEpac SystemEventsEpac;
+
+enum SystemEventsEpmd {
+ SystemEventsEpmdCommand = 'cmdm' /* command */,
+ SystemEventsEpmdControl = 'ctlm' /* control */,
+ SystemEventsEpmdNone = 'none' /* none */,
+ SystemEventsEpmdOption = 'optm' /* option */,
+ SystemEventsEpmdShift = 'shtm' /* shift */
+};
+typedef enum SystemEventsEpmd SystemEventsEpmd;
+
+enum SystemEventsEpfk {
+ SystemEventsEpfkF1 = 'F1ky' /* F1 */,
+ SystemEventsEpfkF10 = 'F10k' /* F10 */,
+ SystemEventsEpfkF11 = 'F11k' /* F11 */,
+ SystemEventsEpfkF12 = 'F12k' /* F12 */,
+ SystemEventsEpfkF13 = 'F13k' /* F13 */,
+ SystemEventsEpfkF14 = 'F14k' /* F14 */,
+ SystemEventsEpfkF15 = 'F15k' /* F15 */,
+ SystemEventsEpfkF16 = 'F16k' /* F16 */,
+ SystemEventsEpfkF17 = 'F17k' /* F17 */,
+ SystemEventsEpfkF18 = 'F18k' /* F18 */,
+ SystemEventsEpfkF19 = 'F19k' /* F19 */,
+ SystemEventsEpfkF2 = 'F2ky' /* F2 */,
+ SystemEventsEpfkF3 = 'F3ky' /* F3 */,
+ SystemEventsEpfkF4 = 'F4ky' /* F4 */,
+ SystemEventsEpfkF5 = 'F5ky' /* F5 */,
+ SystemEventsEpfkF6 = 'F6ky' /* F6 */,
+ SystemEventsEpfkF7 = 'F7ky' /* F7 */,
+ SystemEventsEpfkF8 = 'F8ky' /* F8 */,
+ SystemEventsEpfkF9 = 'F9ky' /* F9 */,
+ SystemEventsEpfkLeftCommand = 'Lcmd' /* left command */,
+ SystemEventsEpfkLeftControl = 'Lctl' /* left control */,
+ SystemEventsEpfkLeftOption = 'Lopt' /* left option */,
+ SystemEventsEpfkLeftShift = 'Lsht' /* left shift */,
+ SystemEventsEpfkNone = 'none' /* none */,
+ SystemEventsEpfkRightCommand = 'Rcmd' /* right command */,
+ SystemEventsEpfkRightControl = 'Rctl' /* right control */,
+ SystemEventsEpfkRightOption = 'Ropt' /* right option */,
+ SystemEventsEpfkRightShift = 'Rsht' /* right shift */,
+ SystemEventsEpfkSecondaryFunctionKey = 'SFky' /* secondary function key */
+};
+typedef enum SystemEventsEpfk SystemEventsEpfk;
+
+enum SystemEventsSclp {
+ SystemEventsSclpTogether = 'tgth' /* together */,
+ SystemEventsSclpTogetherAtTopAndBottom = 'tgtb' /* together at top and bottom */,
+ SystemEventsSclpTopAndBottom = 'tpbt' /* top and bottom */
+};
+typedef enum SystemEventsSclp SystemEventsSclp;
+
+enum SystemEventsSclb {
+ SystemEventsSclbJumpToHere = 'tohr' /* jump to here */,
+ SystemEventsSclbJumpToNextPage = 'nxpg' /* jump to next page */
+};
+typedef enum SystemEventsSclb SystemEventsSclb;
+
+enum SystemEventsFtss {
+ SystemEventsFtssAutomatic = 'autm' /* automatic */,
+ SystemEventsFtssLight = 'lite' /* light */,
+ SystemEventsFtssMedium = 'medi' /* medium */,
+ SystemEventsFtssStandard = 'stnd' /* standard */,
+ SystemEventsFtssStrong = 'strg' /* strong */
+};
+typedef enum SystemEventsFtss SystemEventsFtss;
+
+enum SystemEventsAppe {
+ SystemEventsAppeBlue = 'blue' /* blue */,
+ SystemEventsAppeGraphite = 'grft' /* graphite */
+};
+typedef enum SystemEventsAppe SystemEventsAppe;
+
+enum SystemEventsHico {
+ SystemEventsHicoBlue = 'blue' /* blue */,
+ SystemEventsHicoGold = 'gold' /* gold */,
+ SystemEventsHicoGraphite = 'grft' /* graphite */,
+ SystemEventsHicoGreen = 'gren' /* green */,
+ SystemEventsHicoOrange = 'orng' /* orange */,
+ SystemEventsHicoPurple = 'prpl' /* purple */,
+ SystemEventsHicoRed = 'red ' /* red */,
+ SystemEventsHicoSilver = 'slvr' /* silver */
+};
+typedef enum SystemEventsHico SystemEventsHico;
+
+enum SystemEventsEnum {
+ SystemEventsEnumStandard = 'lwst' /* Standard PostScript error handling */,
+ SystemEventsEnumDetailed = 'lwdt' /* print a detailed report of PostScript errors */
+};
+typedef enum SystemEventsEnum SystemEventsEnum;
+
+
+
+/*
+ * Standard Suite
+ */
+
+// A scriptable object.
+@interface SystemEventsItem : SBObject
+
+@property (copy) NSDictionary *properties; // All of the object's properties.
+
+- (void) closeSaving:(SystemEventsSavo)saving savingIn:(SystemEventsAlias *)savingIn; // Close an object.
+- (void) delete; // Delete an object.
+- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
+- (BOOL) exists; // Verify if an object exists.
+- (void) moveTo:(SBObject *)to; // Move object(s) to a new location.
+- (void) saveAs:(NSString *)as in:(SystemEventsAlias *)in_; // Save an object.
+- (void) start; // start the screen saver
+- (void) stop; // stop the screen saver
+
+@end
+
+// An application's top level scripting object.
+@interface SystemEventsApplication : SBApplication
+
+- (SBElementArray *) documents;
+- (SBElementArray *) windows;
+
+@property (readonly) BOOL frontmost; // Is this the frontmost (active) application?
+@property (copy, readonly) NSString *name; // The name of the application.
+@property (copy, readonly) NSString *version; // The version of the application.
+
+- (void) quitSaving:(SystemEventsSavo)saving; // Quit an application.
+- (void) logOut; // Log out the current user
+- (void) restart; // Restart the computer
+- (void) shutDown; // Shut Down the computer
+- (void) sleep; // Put the computer to sleep
+- (SystemEventsUIElement *) clickAt:(NSArray *)at; // cause the target process to behave as if the UI element were clicked
+- (void) keyCode:(NSInteger)x using:(SystemEventsEMds)using_; // cause the target process to behave as if key codes were entered
+- (void) keystroke:(NSString *)x using:(SystemEventsEMds)using_; // cause the target process to behave as if keystrokes were entered
+- (void) abortTransaction; // Discard the results of a bounded update session with one or more files.
+- (NSInteger) beginTransaction; // Begin a bounded update session with one or more files.
+- (void) endTransaction; // Apply the results of a bounded update session with one or more files.
+- (SystemEventsConfiguration *) connect:(id)x; // connect a configuration or service
+- (SystemEventsConfiguration *) disconnect:(id)x; // disconnect a configuration or service
+
+@end
+
+// A color.
+@interface SystemEventsColor : SystemEventsItem
+
+
+@end
+
+// A document.
+@interface SystemEventsDocument : SystemEventsItem
+
+@property (readonly) BOOL modified; // Has the document been modified since the last save?
+@property (copy) NSString *name; // The document's name.
+@property (copy) NSString *path; // The document's path.
+
+
+@end
+
+// A window.
+@interface SystemEventsWindow : SystemEventsItem
+
+@property NSRect bounds; // The bounding rectangle of the window.
+@property (readonly) BOOL closeable; // Whether the window has a close box.
+@property (copy, readonly) SystemEventsDocument *document; // The document whose contents are being displayed in the window.
+@property (readonly) BOOL floating; // Whether the window floats.
+- (NSInteger) id; // The unique identifier of the window.
+@property NSInteger index; // The index of the window, ordered front to back.
+@property (readonly) BOOL miniaturizable; // Whether the window can be miniaturized.
+@property BOOL miniaturized; // Whether the window is currently miniaturized.
+@property (readonly) BOOL modal; // Whether the window is the application's current modal window.
+@property (copy) NSString *name; // The full title of the window.
+@property (readonly) BOOL resizable; // Whether the window can be resized.
+@property (readonly) BOOL titled; // Whether the window has a title bar.
+@property BOOL visible; // Whether the window is currently visible.
+@property (readonly) BOOL zoomable; // Whether the window can be zoomed.
+@property BOOL zoomed; // Whether the window is currently zoomed.
+
+
+@end
+
+
+
+/*
+ * Text Suite
+ */
+
+// This subdivides the text into chunks that all have the same attributes.
+@interface SystemEventsAttributeRun : SystemEventsItem
+
+- (SBElementArray *) attachments;
+- (SBElementArray *) attributeRuns;
+- (SBElementArray *) characters;
+- (SBElementArray *) paragraphs;
+- (SBElementArray *) words;
+
+@property (copy) NSColor *color; // The color of the first character.
+@property (copy) NSString *font; // The name of the font of the first character.
+@property NSInteger size; // The size in points of the first character.
+
+
+@end
+
+// This subdivides the text into characters.
+@interface SystemEventsCharacter : SystemEventsItem
+
+- (SBElementArray *) attachments;
+- (SBElementArray *) attributeRuns;
+- (SBElementArray *) characters;
+- (SBElementArray *) paragraphs;
+- (SBElementArray *) words;
+
+@property (copy) NSColor *color; // The color of the first character.
+@property (copy) NSString *font; // The name of the font of the first character.
+@property NSInteger size; // The size in points of the first character.
+
+
+@end
+
+// This subdivides the text into paragraphs.
+@interface SystemEventsParagraph : SystemEventsItem
+
+- (SBElementArray *) attachments;
+- (SBElementArray *) attributeRuns;
+- (SBElementArray *) characters;
+- (SBElementArray *) paragraphs;
+- (SBElementArray *) words;
+
+@property (copy) NSColor *color; // The color of the first character.
+@property (copy) NSString *font; // The name of the font of the first character.
+@property NSInteger size; // The size in points of the first character.
+
+
+@end
+
+// Rich (styled) text
+@interface SystemEventsText : SystemEventsItem
+
+- (SBElementArray *) attachments;
+- (SBElementArray *) attributeRuns;
+- (SBElementArray *) characters;
+- (SBElementArray *) paragraphs;
+- (SBElementArray *) words;
+
+@property (copy) NSColor *color; // The color of the first character.
+@property (copy) NSString *font; // The name of the font of the first character.
+@property NSInteger size; // The size in points of the first character.
+
+- (void) keystrokeUsing:(SystemEventsEMds)using_; // cause the target process to behave as if keystrokes were entered
+
+@end
+
+// Represents an inline text attachment. This class is used mainly for make commands.
+@interface SystemEventsAttachment : SystemEventsText
+
+@property (copy) NSString *fileName; // The path to the file for the attachment
+
+
+@end
+
+// This subdivides the text into words.
+@interface SystemEventsWord : SystemEventsItem
+
+- (SBElementArray *) attachments;
+- (SBElementArray *) attributeRuns;
+- (SBElementArray *) characters;
+- (SBElementArray *) paragraphs;
+- (SBElementArray *) words;
+
+@property (copy) NSColor *color; // The color of the first character.
+@property (copy) NSString *font; // The name of the font of the first character.
+@property NSInteger size; // The size in points of the first character.
+
+
+@end
+
+
+
+/*
+ * Dock Preferences Suite
+ */
+
+// user's dock preferences
+@interface SystemEventsDockPreferencesObject : SystemEventsItem
+
+@property BOOL animate; // is the animation of opening applications on or off?
+@property BOOL autohide; // is autohiding the dock on or off?
+@property double dockSize; // size/height of the items (between 0.0 (minimum) and 1.0 (maximum))
+@property BOOL magnification; // is magnification on or off?
+@property double magnificationSize; // maximum magnification size when magnification is on (between 0.0 (minimum) and 1.0 (maximum))
+@property SystemEventsDpef minimizeEffect; // minimization effect
+@property SystemEventsDpls screenEdge; // location on screen
+
+
+@end
+
+
+
+/*
+ * CD and DVD Preferences Suite
+ */
+
+// user's CD and DVD insertion preferences
+@interface SystemEventsCDAndDVDPreferencesObject : SystemEventsItem
+
+@property (copy, readonly) SystemEventsInsertionPreference *blankBD; // the blank BD insertion preference
+@property (copy, readonly) SystemEventsInsertionPreference *blankCD; // the blank CD insertion preference
+@property (copy, readonly) SystemEventsInsertionPreference *musicCD; // the music CD insertion preference
+@property (copy, readonly) SystemEventsInsertionPreference *pictureCD; // the picture CD insertion preference
+@property (copy, readonly) SystemEventsInsertionPreference *videoBD; // the video BD insertion preference
+@property (copy, readonly) SystemEventsInsertionPreference *videoDVD; // the video DVD insertion preference
+
+
+@end
+
+// a specific insertion preference
+@interface SystemEventsInsertionPreference : SystemEventsItem
+
+@property (copy) SystemEventsAlias *customApplication; // application to launch or activate on the insertion of media
+@property (copy) SystemEventsAlias *customScript; // AppleScript to launch or activate on the insertion of media
+@property SystemEventsDhac insertionAction; // action to perform on media insertion
+
+
+@end
+
+
+
+/*
+ * Accounts Suite
+ */
+
+// user account
+@interface SystemEventsUser : SystemEventsItem
+
+@property (copy, readonly) NSString *fullName; // user's full name
+@property (copy, readonly) SystemEventsAlias *homeDirectory; // path to user's home directory
+@property (copy, readonly) NSString *name; // user's short name
+@property (copy) SystemEventsAlias *picturePath; // path to user's picture. Can be set for current user only!
+
+
+@end
+
+
+
+/*
+ * Login Items Suite
+ */
+
+// an item to be launched or opened at login
+@interface SystemEventsLoginItem : SystemEventsItem
+
+@property BOOL hidden; // Is the Login Item hidden when launched?
+@property (copy, readonly) NSString *kind; // the file type of the Login Item
+@property (copy, readonly) NSString *name; // the name of the Login Item
+@property (copy, readonly) NSString *path; // the file system path to the Login Item
+
+
+@end
+
+
+
+/*
+ * Screen Saver Suite
+ */
+
+// an installed screen saver
+@interface SystemEventsScreenSaver : SystemEventsItem
+
+@property (copy, readonly) NSString *displayedName; // name of the screen saver module as displayed to the user
+@property (copy, readonly) NSString *name; // name of the screen saver module to be displayed
+@property (copy, readonly) SystemEventsAlias *path; // path to the screen saver module
+@property (copy) NSString *pictureDisplayStyle; // effect to use when displaying picture-based screen savers (slideshow, collage, or mosaic)
+
+
+@end
+
+// screen saver settings
+@interface SystemEventsScreenSaverPreferencesObject : SystemEventsItem
+
+@property NSInteger delayInterval; // number of seconds of idle time before the screen saver starts; zero for never
+@property BOOL mainScreenOnly; // should the screen saver be shown only on the main screen?
+@property (readonly) BOOL running; // is the screen saver running?
+@property BOOL showClock; // should a clock appear over the screen saver?
+
+
+@end
+
+
+
+/*
+ * Disk-Folder-File Suite
+ */
+
+// An item stored in the file system
+@interface SystemEventsDiskItem : SystemEventsItem
+
+@property (readonly) BOOL busyStatus; // Is the disk item busy?
+@property (copy, readonly) SystemEventsDiskItem *container; // the folder or disk which has this disk item as an element
+@property (copy, readonly) NSDate *creationDate; // the date on which the disk item was created
+@property (copy, readonly) NSString *displayedName; // the name of the disk item as displayed in the User Interface
+- (NSString *) id; // the unique ID of the disk item
+@property (copy) NSDate *modificationDate; // the date on which the disk item was last modified
+@property (copy) NSString *name; // the name of the disk item
+@property (copy, readonly) NSString *nameExtension; // the extension portion of the name
+@property (readonly) BOOL packageFolder; // Is the disk item a package?
+@property (copy, readonly) NSString *path; // the file system path of the disk item
+@property (readonly) long long physicalSize; // the actual space used by the disk item on disk
+@property (copy, readonly) NSString *POSIXPath; // the POSIX file system path of the disk item
+@property (readonly) long long size; // the logical size of the disk item
+@property (copy, readonly) NSString *URL; // the URL of the disk item
+@property BOOL visible; // Is the disk item visible?
+@property (copy, readonly) NSString *volume; // the volume on which the disk item resides
+
+- (void) delete; // Delete disk item(s).
+- (SystemEventsDiskItem *) moveTo:(SBObject *)to; // Move disk item(s) to a new location.
+
+@end
+
+// An alias in the file system
+@interface SystemEventsAlias : SystemEventsDiskItem
+
+- (SBElementArray *) aliases;
+- (SBElementArray *) diskItems;
+- (SBElementArray *) files;
+- (SBElementArray *) filePackages;
+- (SBElementArray *) folders;
+- (SBElementArray *) items;
+
+@property (copy) NSString *creatorType; // the OSType identifying the application that created the alias
+@property (copy) NSString *fileType; // the OSType identifying the type of data contained in the alias
+@property (copy, readonly) NSString *kind; // The kind of alias, as shown in Finder
+@property (copy, readonly) NSString *productVersion; // the version of the product (visible at the top of the "Get Info" window)
+@property (copy, readonly) NSString *shortVersion; // the short version of the application bundle referenced by the alias
+@property BOOL stationery; // Is the alias a stationery pad?
+@property (copy, readonly) NSString *typeIdentifier; // The type identifier of the alias
+@property (copy, readonly) NSString *version; // the version of the application bundle referenced by the alias (visible at the bottom of the "Get Info" window)
+
+- (SystemEventsDocument *) open; // Open an object.
+- (void) printPrintDialog:(BOOL)printDialog withProperties:(SystemEventsPrintSettings *)withProperties; // Print an object.
+
+@end
+
+// A disk in the file system
+@interface SystemEventsDisk : SystemEventsDiskItem
+
+- (SBElementArray *) aliases;
+- (SBElementArray *) diskItems;
+- (SBElementArray *) files;
+- (SBElementArray *) filePackages;
+- (SBElementArray *) folders;
+- (SBElementArray *) items;
+
+@property (readonly) long long capacity; // the total number of bytes (free or used) on the disk
+@property (readonly) BOOL ejectable; // Can the media be ejected (floppies, CD's, and so on)?
+@property (readonly) SystemEventsEdfm format; // the file system format of this disk
+@property (readonly) long long freeSpace; // the number of free bytes left on the disk
+@property BOOL ignorePrivileges; // Ignore permissions on this disk?
+@property (readonly) BOOL localVolume; // Is the media a local volume (as opposed to a file server)?
+@property (copy, readonly) NSString *server; // the server on which the disk resides, AFP volumes only
+@property (readonly) BOOL startup; // Is this disk the boot disk?
+@property (copy, readonly) NSString *zone; // the zone in which the disk's server resides, AFP volumes only
+
+
+@end
+
+// A domain in the file system
+@interface SystemEventsDomain : SystemEventsItem
+
+- (SBElementArray *) folders;
+
+@property (copy, readonly) SystemEventsFolder *applicationSupportFolder; // The Application Support folder
+@property (copy, readonly) SystemEventsFolder *applicationsFolder; // The Applications folder
+@property (copy, readonly) SystemEventsFolder *desktopPicturesFolder; // The Desktop Pictures folder
+@property (copy, readonly) SystemEventsFolder *FolderActionScriptsFolder; // The Folder Action Scripts folder
+@property (copy, readonly) SystemEventsFolder *fontsFolder; // The Fonts folder
+- (NSString *) id; // the unique identifier of the domain
+@property (copy, readonly) SystemEventsFolder *libraryFolder; // The Library folder
+@property (copy, readonly) NSString *name; // the name of the domain
+@property (copy, readonly) SystemEventsFolder *preferencesFolder; // The Preferences folder
+@property (copy, readonly) SystemEventsFolder *scriptingAdditionsFolder; // The Scripting Additions folder
+@property (copy, readonly) SystemEventsFolder *scriptsFolder; // The Scripts folder
+@property (copy, readonly) SystemEventsFolder *sharedDocumentsFolder; // The Shared Documents folder
+@property (copy, readonly) SystemEventsFolder *speakableItemsFolder; // The Speakable Items folder
+@property (copy, readonly) SystemEventsFolder *utilitiesFolder; // The Utilities folder
+@property (copy, readonly) SystemEventsFolder *workflowsFolder; // The Automator Workflows folder
+
+
+@end
+
+// The Classic domain in the file system
+@interface SystemEventsClassicDomainObject : SystemEventsDomain
+
+- (SBElementArray *) folders;
+
+@property (copy, readonly) SystemEventsFolder *appleMenuFolder; // The Apple Menu Items folder
+@property (copy, readonly) SystemEventsFolder *controlPanelsFolder; // The Control Panels folder
+@property (copy, readonly) SystemEventsFolder *controlStripModulesFolder; // The Control Strip Modules folder
+@property (copy, readonly) SystemEventsFolder *desktopFolder; // The Classic Desktop folder
+@property (copy, readonly) SystemEventsFolder *extensionsFolder; // The Extensions folder
+@property (copy, readonly) SystemEventsFolder *fontsFolder; // The Fonts folder
+@property (copy, readonly) SystemEventsFolder *launcherItemsFolder; // The Launcher Items folder
+@property (copy, readonly) SystemEventsFolder *preferencesFolder; // The Classic Preferences folder
+@property (copy, readonly) SystemEventsFolder *shutdownFolder; // The Shutdown Items folder
+@property (copy, readonly) SystemEventsFolder *startupItemsFolder; // The StartupItems folder
+@property (copy, readonly) SystemEventsFolder *systemFolder; // The System folder
+
+
+@end
+
+// A file in the file system
+@interface SystemEventsFile : SystemEventsDiskItem
+
+@property (copy) NSString *creatorType; // the OSType identifying the application that created the file
+@property (copy) SystemEventsDiskItem *defaultApplication; // the application that will launch if the file is opened
+@property (copy) NSString *fileType; // the OSType identifying the type of data contained in the file
+@property (copy, readonly) NSString *kind; // The kind of file, as shown in Finder
+@property (copy, readonly) NSString *productVersion; // the version of the product (visible at the top of the "Get Info" window)
+@property (copy, readonly) NSString *shortVersion; // the short version of the file
+@property BOOL stationery; // Is the file a stationery pad?
+@property (copy, readonly) NSString *typeIdentifier; // The type identifier of the file
+@property (copy, readonly) NSString *version; // the version of the file (visible at the bottom of the "Get Info" window)
+
+- (SystemEventsFile *) open; // Open disk item(s) with the appropriate application.
+
+@end
+
+// A file package in the file system
+@interface SystemEventsFilePackage : SystemEventsFile
+
+- (SBElementArray *) aliases;
+- (SBElementArray *) diskItems;
+- (SBElementArray *) files;
+- (SBElementArray *) filePackages;
+- (SBElementArray *) folders;
+- (SBElementArray *) items;
+
+
+@end
+
+// A folder in the file system
+@interface SystemEventsFolder : SystemEventsDiskItem
+
+- (SBElementArray *) aliases;
+- (SBElementArray *) diskItems;
+- (SBElementArray *) files;
+- (SBElementArray *) filePackages;
+- (SBElementArray *) folders;
+- (SBElementArray *) items;
+
+
+@end
+
+// An item stored in the file system
+@interface SystemEventsItem (DiskFolderFileSuite)
+
+- (NSString *) id; // the unique ID of the item
+@property (copy) NSString *name; // the name of the item
+
+@end
+
+// The local domain in the file system
+@interface SystemEventsLocalDomainObject : SystemEventsDomain
+
+- (SBElementArray *) folders;
+
+
+@end
+
+// The network domain in the file system
+@interface SystemEventsNetworkDomainObject : SystemEventsDomain
+
+- (SBElementArray *) folders;
+
+
+@end
+
+// The system domain in the file system
+@interface SystemEventsSystemDomainObject : SystemEventsDomain
+
+- (SBElementArray *) folders;
+
+
+@end
+
+// The user domain in the file system
+@interface SystemEventsUserDomainObject : SystemEventsDomain
+
+- (SBElementArray *) folders;
+
+@property (copy, readonly) SystemEventsFolder *desktopFolder; // The user's Desktop folder
+@property (copy, readonly) SystemEventsFolder *documentsFolder; // The user's Documents folder
+@property (copy, readonly) SystemEventsFolder *downloadsFolder; // The user's Downloads folder
+@property (copy, readonly) SystemEventsFolder *favoritesFolder; // The user's Favorites folder
+@property (copy, readonly) SystemEventsFolder *homeFolder; // The user's Home folder
+@property (copy, readonly) SystemEventsFolder *moviesFolder; // The user's Movies folder
+@property (copy, readonly) SystemEventsFolder *musicFolder; // The user's Music folder
+@property (copy, readonly) SystemEventsFolder *picturesFolder; // The user's Pictures folder
+@property (copy, readonly) SystemEventsFolder *publicFolder; // The user's Public folder
+@property (copy, readonly) SystemEventsFolder *sitesFolder; // The user's Sites folder
+@property (copy, readonly) SystemEventsFolder *temporaryItemsFolder; // The Temporary Items folder
+
+
+@end
+
+
+
+/*
+ * Folder Actions Suite
+ */
+
+// An action attached to a folder in the file system
+@interface SystemEventsFolderAction : SystemEventsItem
+
+- (SBElementArray *) scripts;
+
+@property BOOL enabled; // Is the folder action enabled?
+@property (copy) NSString *name; // the name of the folder action, which is also the name of the folder
+@property (copy, readonly) NSString *path; // the path to the folder to which the folder action applies
+@property (copy, readonly) NSString *volume; // the volume on which the folder action resides
+
+
+@end
+
+// A script invoked by a folder action
+@interface SystemEventsScript : SystemEventsItem
+
+@property BOOL enabled; // Is the script enabled?
+@property (copy, readonly) NSString *name; // the name of the script
+@property (copy, readonly) NSString *path; // the file system path of the disk
+@property (copy, readonly) NSString *POSIXPath; // the POSIX file system path of the disk
+
+
+@end
+
+
+
+/*
+ * Processes Suite
+ */
+
+// An action that can be performed on the UI element
+@interface SystemEventsAction : SystemEventsItem
+
+@property (copy, readonly) NSString *objectDescription; // what the action does
+@property (copy, readonly) NSString *name; // the name of the action
+
+- (SystemEventsAction *) perform; // cause the target process to behave as if the action were applied to its UI element
+
+@end
+
+// An named data value associated with the UI element
+@interface SystemEventsAttribute : SystemEventsItem
+
+@property (copy, readonly) NSString *name; // the name of the attribute
+@property (readonly) BOOL settable; // Can the attribute be set?
+@property (copy) id value; // the current value of the attribute
+
+
+@end
+
+// A piece of the user interface of a process
+@interface SystemEventsUIElement : SystemEventsItem
+
+- (SBElementArray *) actions;
+- (SBElementArray *) attributes;
+- (SBElementArray *) browsers;
+- (SBElementArray *) busyIndicators;
+- (SBElementArray *) buttons;
+- (SBElementArray *) checkboxes;
+- (SBElementArray *) colorWells;
+- (SBElementArray *) columns;
+- (SBElementArray *) comboBoxes;
+- (SBElementArray *) drawers;
+- (SBElementArray *) groups;
+- (SBElementArray *) growAreas;
+- (SBElementArray *) images;
+- (SBElementArray *) incrementors;
+- (SBElementArray *) lists;
+- (SBElementArray *) menus;
+- (SBElementArray *) menuBars;
+- (SBElementArray *) menuBarItems;
+- (SBElementArray *) menuButtons;
+- (SBElementArray *) menuItems;
+- (SBElementArray *) outlines;
+- (SBElementArray *) popUpButtons;
+- (SBElementArray *) progressIndicators;
+- (SBElementArray *) radioButtons;
+- (SBElementArray *) radioGroups;
+- (SBElementArray *) relevanceIndicators;
+- (SBElementArray *) rows;
+- (SBElementArray *) scrollAreas;
+- (SBElementArray *) scrollBars;
+- (SBElementArray *) sheets;
+- (SBElementArray *) sliders;
+- (SBElementArray *) splitters;
+- (SBElementArray *) splitterGroups;
+- (SBElementArray *) staticTexts;
+- (SBElementArray *) tabGroups;
+- (SBElementArray *) tables;
+- (SBElementArray *) textAreas;
+- (SBElementArray *) textFields;
+- (SBElementArray *) toolBars;
+- (SBElementArray *) UIElements;
+- (SBElementArray *) valueIndicators;
+- (SBElementArray *) windows;
+
+@property (copy, readonly) NSString *accessibilityDescription; // a more complete description of the UI element and its capabilities
+@property (copy, readonly) NSString *objectDescription; // the accessibility description, if available; otherwise, the role description
+@property (readonly) BOOL enabled; // Is the UI element enabled? ( Does it accept clicks? )
+@property (copy, readonly) NSArray *entireContents; // a list of every UI element contained in this UI element and its child UI elements, to the limits of the tree
+@property BOOL focused; // Is the focus on this UI element?
+@property (copy, readonly) NSString *help; // an elaborate description of the UI element and its capabilities
+@property (readonly) NSInteger maximumValue; // the maximum value that the UI element can take on
+@property (readonly) NSInteger minimumValue; // the minimum value that the UI element can take on
+@property (copy, readonly) NSString *name; // the name of the UI Element, which identifies it within its container
+@property (copy, readonly) NSString *orientation; // the orientation of the UI element
+@property (copy) NSArray *position; // the position of the UI element
+@property (copy, readonly) NSString *role; // an encoded description of the UI element and its capabilities
+@property (copy, readonly) NSString *roleDescription; // a more complete description of the UI element's role
+@property BOOL selected; // Is the UI element selected?
+@property (copy) NSArray *size; // the size of the UI element
+@property (copy, readonly) NSString *subrole; // an encoded description of the UI element and its capabilities
+@property (copy, readonly) NSString *title; // the title of the UI element as it appears on the screen
+@property NSInteger value; // the current value of the UI element
+
+- (SystemEventsUIElement *) clickAt:(NSArray *)at; // cause the target process to behave as if the UI element were clicked
+- (SystemEventsUIElement *) select; // set the selected property of the UI element
+
+@end
+
+// A browser belonging to a window
+@interface SystemEventsBrowser : SystemEventsUIElement
+
+
+@end
+
+// A busy indicator belonging to a window
+@interface SystemEventsBusyIndicator : SystemEventsUIElement
+
+
+@end
+
+// A button belonging to a window or scroll bar
+@interface SystemEventsButton : SystemEventsUIElement
+
+
+@end
+
+// A checkbox belonging to a window
+@interface SystemEventsCheckbox : SystemEventsUIElement
+
+
+@end
+
+// A color well belonging to a window
+@interface SystemEventsColorWell : SystemEventsUIElement
+
+
+@end
+
+// A column belonging to a table
+@interface SystemEventsColumn : SystemEventsUIElement
+
+
+@end
+
+// A combo box belonging to a window
+@interface SystemEventsComboBox : SystemEventsUIElement
+
+
+@end
+
+// A drawer that may be extended from a window
+@interface SystemEventsDrawer : SystemEventsUIElement
+
+
+@end
+
+// A group belonging to a window
+@interface SystemEventsGroup : SystemEventsUIElement
+
+- (SBElementArray *) checkboxes;
+- (SBElementArray *) staticTexts;
+
+
+@end
+
+// A grow area belonging to a window
+@interface SystemEventsGrowArea : SystemEventsUIElement
+
+
+@end
+
+// An image belonging to a static text field
+@interface SystemEventsImage : SystemEventsUIElement
+
+
+@end
+
+// A incrementor belonging to a window
+@interface SystemEventsIncrementor : SystemEventsUIElement
+
+
+@end
+
+// A list belonging to a window
+@interface SystemEventsList : SystemEventsUIElement
+
+
+@end
+
+// A menu belonging to a menu bar item
+@interface SystemEventsMenu : SystemEventsUIElement
+
+- (SBElementArray *) menuItems;
+
+
+@end
+
+// A menu bar belonging to a process
+@interface SystemEventsMenuBar : SystemEventsUIElement
+
+- (SBElementArray *) menus;
+- (SBElementArray *) menuBarItems;
+
+
+@end
+
+// A menu bar item belonging to a menu bar
+@interface SystemEventsMenuBarItem : SystemEventsUIElement
+
+- (SBElementArray *) menus;
+
+
+@end
+
+// A menu button belonging to a window
+@interface SystemEventsMenuButton : SystemEventsUIElement
+
+
+@end
+
+// A menu item belonging to a menu
+@interface SystemEventsMenuItem : SystemEventsUIElement
+
+- (SBElementArray *) menus;
+
+
+@end
+
+// A outline belonging to a window
+@interface SystemEventsOutline : SystemEventsUIElement
+
+
+@end
+
+// A pop up button belonging to a window
+@interface SystemEventsPopUpButton : SystemEventsUIElement
+
+
+@end
+
+// A process running on this computer
+@interface SystemEventsProcess : SystemEventsUIElement
+
+- (SBElementArray *) menuBars;
+- (SBElementArray *) windows;
+
+@property (readonly) BOOL acceptsHighLevelEvents; // Is the process high-level event aware (accepts open application, open document, print document, and quit)?
+@property (readonly) BOOL acceptsRemoteEvents; // Does the process accept remote events?
+@property (copy, readonly) NSString *architecture; // the architecture in which the process is running
+@property (readonly) BOOL backgroundOnly; // Does the process run exclusively in the background?
+@property (copy, readonly) NSString *bundleIdentifier; // the bundle identifier of the process' application file
+@property (readonly) BOOL Classic; // Is the process running in the Classic environment?
+@property (copy, readonly) NSString *creatorType; // the OSType of the creator of the process (the signature)
+@property (copy, readonly) NSString *displayedName; // the name of the file from which the process was launched, as displayed in the User Interface
+@property (copy, readonly) SystemEventsAlias *file; // the file from which the process was launched
+@property (copy, readonly) NSString *fileType; // the OSType of the file type of the process
+@property BOOL frontmost; // Is the process the frontmost process
+@property (readonly) BOOL hasScriptingTerminology; // Does the process have a scripting terminology, i.e., can it be scripted?
+- (NSInteger) id; // The unique identifier of the process
+@property (copy, readonly) NSString *name; // the name of the process
+@property (readonly) NSInteger partitionSpaceUsed; // the number of bytes currently used in the process' partition
+@property (copy, readonly) NSString *shortName; // the short name of the file from which the process was launched
+@property (readonly) NSInteger totalPartitionSize; // the size of the partition with which the process was launched
+@property (readonly) NSInteger unixId; // The Unix process identifier of a process running in the native environment, or -1 for a process running in the Classic environment
+@property BOOL visible; // Is the process' layer visible?
+
+
+@end
+
+// A process launched from an application file
+@interface SystemEventsApplicationProcess : SystemEventsProcess
+
+@property (copy, readonly) SystemEventsAlias *applicationFile; // a reference to the application file from which this process was launched
+
+
+@end
+
+// A process launched from an desk accessory file
+@interface SystemEventsDeskAccessoryProcess : SystemEventsProcess
+
+@property (copy, readonly) SystemEventsAlias *deskAccessoryFile; // a reference to the desk accessory file from which this process was launched
+
+
+@end
+
+// A progress indicator belonging to a window
+@interface SystemEventsProgressIndicator : SystemEventsUIElement
+
+
+@end
+
+// A radio button belonging to a window
+@interface SystemEventsRadioButton : SystemEventsUIElement
+
+
+@end
+
+// A radio button group belonging to a window
+@interface SystemEventsRadioGroup : SystemEventsUIElement
+
+- (SBElementArray *) radioButtons;
+
+
+@end
+
+// A relevance indicator belonging to a window
+@interface SystemEventsRelevanceIndicator : SystemEventsUIElement
+
+
+@end
+
+// A row belonging to a table
+@interface SystemEventsRow : SystemEventsUIElement
+
+
+@end
+
+// A scroll area belonging to a window
+@interface SystemEventsScrollArea : SystemEventsUIElement
+
+
+@end
+
+// A scroll bar belonging to a window
+@interface SystemEventsScrollBar : SystemEventsUIElement
+
+- (SBElementArray *) buttons;
+- (SBElementArray *) valueIndicators;
+
+
+@end
+
+// A sheet displayed over a window
+@interface SystemEventsSheet : SystemEventsUIElement
+
+
+@end
+
+// A slider belonging to a window
+@interface SystemEventsSlider : SystemEventsUIElement
+
+
+@end
+
+// A splitter belonging to a window
+@interface SystemEventsSplitter : SystemEventsUIElement
+
+
+@end
+
+// A splitter group belonging to a window
+@interface SystemEventsSplitterGroup : SystemEventsUIElement
+
+
+@end
+
+// A static text field belonging to a window
+@interface SystemEventsStaticText : SystemEventsUIElement
+
+- (SBElementArray *) images;
+
+
+@end
+
+// A tab group belonging to a window
+@interface SystemEventsTabGroup : SystemEventsUIElement
+
+
+@end
+
+// A table belonging to a window
+@interface SystemEventsTable : SystemEventsUIElement
+
+
+@end
+
+// A text area belonging to a window
+@interface SystemEventsTextArea : SystemEventsUIElement
+
+
+@end
+
+// A text field belonging to a window
+@interface SystemEventsTextField : SystemEventsUIElement
+
+
+@end
+
+// A tool bar belonging to a window
+@interface SystemEventsToolBar : SystemEventsUIElement
+
+
+@end
+
+// A value indicator ( thumb or slider ) belonging to a scroll bar
+@interface SystemEventsValueIndicator : SystemEventsUIElement
+
+
+@end
+
+// A window belonging to a process
+@interface SystemEventsWindow (ProcessesSuite)
+
+- (SBElementArray *) browsers;
+- (SBElementArray *) busyIndicators;
+- (SBElementArray *) buttons;
+- (SBElementArray *) checkboxes;
+- (SBElementArray *) colorWells;
+- (SBElementArray *) comboBoxes;
+- (SBElementArray *) drawers;
+- (SBElementArray *) groups;
+- (SBElementArray *) growAreas;
+- (SBElementArray *) images;
+- (SBElementArray *) incrementors;
+- (SBElementArray *) lists;
+- (SBElementArray *) menuButtons;
+- (SBElementArray *) outlines;
+- (SBElementArray *) popUpButtons;
+- (SBElementArray *) progressIndicators;
+- (SBElementArray *) radioButtons;
+- (SBElementArray *) radioGroups;
+- (SBElementArray *) relevanceIndicators;
+- (SBElementArray *) scrollAreas;
+- (SBElementArray *) scrollBars;
+- (SBElementArray *) sheets;
+- (SBElementArray *) sliders;
+- (SBElementArray *) splitters;
+- (SBElementArray *) splitterGroups;
+- (SBElementArray *) staticTexts;
+- (SBElementArray *) tabGroups;
+- (SBElementArray *) tables;
+- (SBElementArray *) textAreas;
+- (SBElementArray *) textFields;
+- (SBElementArray *) toolBars;
+- (SBElementArray *) UIElements;
+
+@end
+
+
+
+/*
+ * Property List Suite
+ */
+
+// A file containing data in Property List format
+@interface SystemEventsPropertyListFile : SystemEventsFile
+
+@property (copy) SystemEventsPropertyListItem *contents; // the contents of the property list file; elements and properties of the property list item may be accessed as if they were elements and properties of the property list file
+
+
+@end
+
+// A unit of data in Property List format
+@interface SystemEventsPropertyListItem : SystemEventsItem
+
+- (SBElementArray *) propertyListItems;
+
+@property (copy, readonly) NSNumber *kind; // the kind of data stored in the property list item: boolean/data/date/list/number/record/string
+@property (copy, readonly) NSString *name; // the name of the property list item ( if any )
+@property (copy) NSString *text; // the text representation of the property list data
+@property (copy) id value; // the value of the property list item
+
+
+@end
+
+
+
+/*
+ * QuickTime File Suite
+ */
+
+// A unit of user data in a QuickTime file
+@interface SystemEventsAnnotation : SystemEventsItem
+
+@property (copy, readonly) NSString *fullText; // the full text of the annotation
+- (NSString *) id; // the unique identifier of the annotation
+@property (copy, readonly) NSString *name; // the name of the annotation
+
+
+@end
+
+// Data in QuickTime format
+@interface SystemEventsQuickTimeData : SystemEventsItem
+
+- (SBElementArray *) annotations;
+- (SBElementArray *) tracks;
+
+@property (readonly) BOOL autoPlay; // will the movie automatically start playing? (saved with QuickTime file)
+@property (readonly) BOOL autoPresent; // will the movie automatically start presenting? (saved with QuickTime file)
+@property (readonly) BOOL autoQuitWhenDone; // will the player automatically quit when done playing? (saved with QuickTime file)
+@property (copy, readonly) NSDate *creationTime; // the creation time of the QuickTime file
+@property (readonly) NSInteger dataSize; // the size of the QuickTime file data
+@property (readonly) NSInteger duration; // the duration of the QuickTime file, in terms of the time scale
+@property (copy, readonly) NSString *href; // the internet location to open when clicking on the movie (overrides track hrefs)
+@property (readonly) BOOL looping; // keep playing the movie in a loop?
+@property (copy, readonly) NSDate *modificationTime; // the modification time of the QuickTime file
+@property (readonly) NSInteger preferredRate; // the preferred rate of the QuickTime file
+@property (readonly) NSInteger preferredVolume; // the preferred volume of the QuickTime file
+@property (readonly) SystemEventsPrmd presentationMode; // mode in which the movie will be presented
+@property (readonly) SystemEventsMvsz presentationSize; // size at which the movie will be presented
+@property (readonly) BOOL storedStream; // is this a stored streaming movie?
+@property (readonly) NSInteger timeScale; // the time scale of the QuickTime file
+
+
+@end
+
+
+
+/*
+ * Audio File Suite
+ */
+
+// Data in Audio format
+@interface SystemEventsAudioData : SystemEventsQuickTimeData
+
+
+@end
+
+
+
+/*
+ * Movie File Suite
+ */
+
+// Data in Movie format
+@interface SystemEventsMovieData : SystemEventsQuickTimeData
+
+@property (copy, readonly) NSArray *bounds; // the bounding rectangle of the movie file
+@property (copy, readonly) NSArray *naturalDimensions; // the dimensions the movie has when it is not scaled
+@property (readonly) NSInteger previewDuration; // the preview duration of the movie file
+@property (readonly) NSInteger previewTime; // the preview time of the movie file
+
+
+@end
+
+
+
+/*
+ * QuickTime File Suite
+ */
+
+// A file containing data in QuickTime format
+@interface SystemEventsQuickTimeFile : SystemEventsFile
+
+@property (copy, readonly) SystemEventsQuickTimeData *contents; // the contents of the QuickTime file; elements and properties of the QuickTime data may be accessed as if they were elements and properties of the QuickTime file
+
+
+@end
+
+
+
+/*
+ * Audio File Suite
+ */
+
+// A file containing data in Audio format
+@interface SystemEventsAudioFile : SystemEventsQuickTimeFile
+
+@property (copy, readonly) SystemEventsAudioData *contents; // the contents of the audio file; elements and properties of the audio data may be accessed as if they were elements and properties of the audio file
+
+
+@end
+
+
+
+/*
+ * Movie File Suite
+ */
+
+// A file containing data in Movie format
+@interface SystemEventsMovieFile : SystemEventsQuickTimeFile
+
+@property (copy, readonly) SystemEventsMovieData *contents; // the contents of the movie file; elements and properties of the movie data may be accessed as if they were elements and properties of the movie file
+
+
+@end
+
+
+
+/*
+ * QuickTime File Suite