Class: Osaka::Numbers
Instance Attribute Summary
#control
Class Method Summary
collapse
Instance Method Summary
collapse
#activate, #close, #close_dialog_sheet_with_dont_save, #copy, #create_dialog, #create_document, #cut, #do_and_wait_for_new_window, #duplicate, #duplicate_and_close_original, #duplicate_available?, #focus, #get_info, #initialize_copy, #open, #paste, #print_dialog, #quit, #raise_error_on_open_standard_windows, #running?, #save, #save_as, #save_pops_up_dialog?, #select_all, #select_file_from_open_dialog, #wait_for_application_to_quit, #wait_for_save_dialog_and_save_file, #wait_for_window_and_dialogs_to_close
Constructor Details
Returns a new instance of Numbers.
16
17
18
|
# File 'lib/osaka/numbers.rb', line 16
def initialize
super "Numbers"
end
|
Class Method Details
.create_document(filename, &block) ⇒ Object
27
28
29
30
|
# File 'lib/osaka/numbers.rb', line 27
def self.create_document(filename, &block)
numbers = Osaka::Numbers.new
numbers.create_document(filename, &block)
end
|
Instance Method Details
#column_count ⇒ Object
39
40
41
|
# File 'lib/osaka/numbers.rb', line 39
def column_count
control.tell("tell document 1; tell sheet 1; tell table 1; get column count; end tell; end tell; end tell").to_i
end
|
#fill_cell(column, row, value) ⇒ Object
32
33
34
35
36
37
|
# File 'lib/osaka/numbers.rb', line 32
def fill_cell(column, row, value)
if (column > column_count)
set_column_count(column)
end
control.tell("tell document 1; tell sheet 1; tell table 1; set value of cell #{column} of row #{row} to \"#{value}\"; end tell; end tell; end tell")
end
|
#new_document ⇒ Object
20
21
22
23
24
25
|
# File 'lib/osaka/numbers.rb', line 20
def new_document
super
control.set_current_window(do_and_wait_for_new_window {
control.keystroke(:return)
})
end
|
#set_column_count(amount) ⇒ Object
43
44
45
|
# File 'lib/osaka/numbers.rb', line 43
def set_column_count(amount)
control.tell("tell document 1; tell sheet 1; tell table 1; set column count to #{amount}; end tell; end tell; end tell")
end
|
#set_header_columns(column) ⇒ Object
47
48
49
|
# File 'lib/osaka/numbers.rb', line 47
def set_header_columns(column)
control.(at.(column.to_s).(1).("Header Columns"), "Table")
end
|