Class: Osaka::TypicalFinderDialog

Inherits:
Object
  • Object
show all
Defined in:
lib/osaka/typicalfinderdialog.rb

Direct Known Subclasses

TypicalOpenDialog, TypicalSaveDialog

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(application_name, own_location) ⇒ TypicalFinderDialog

Returns a new instance of TypicalFinderDialog.



7
8
9
# File 'lib/osaka/typicalfinderdialog.rb', line 7

def initialize(application_name, own_location)
  @control = Osaka::RemoteControl.new(application_name, own_location)
end

Instance Attribute Details

#controlObject

Returns the value of attribute control.



5
6
7
# File 'lib/osaka/typicalfinderdialog.rb', line 5

def control
  @control
end

Instance Method Details

#set_folder(pathname) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/osaka/typicalfinderdialog.rb', line 11

def set_folder(pathname)
  return if pathname == "."
  control.keystroke("g", [ :command, :shift ]).wait_until_exists(at.sheet(1))
  control.set("value", at.text_field(1).sheet(1), pathname)
  sleep(1) # Seems this must be here due to the sucking Apple UI. Not found something else to wait for!
  control.click(at.button("Go").sheet(1)).wait_until_not_exists(at.sheet(1))
end