Method: Osascript::Safari.document_text

Defined in:
lib/osascript/Safari.rb

.document_textObject

+options tab (for instance : options = ‘tab 2 of window 1’).

Returns:

  • the text displayed of front document or of the



69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/osascript/Safari.rb', line 69

def document_text
  options ||= {}
  where = options[:where] || 'front document'
  code = "  if count of window is 0\n    return null\n  else\n    return text of (\#{where})\n  end\n  CODE\n  Osascript::__asrun(code, 'Safari')\nend\n"