So I used to be able to do one of these two tricks to find the console text view in Pythonista 3.2 and grab the text out of it...
Search the view hierarchy from the root and compare objc classes:
def findConsoleView():
OMTextView = objc_util.ObjCClass("OMTextView")
OMTextEditorView = objc_util.ObjCClass("OMTextEditorView")
app = objc_util.UIApplication.sharedApplication()
mainwindow = app.keyWindow()
mainview = mainwindow.rootViewController().view()
consoleview = None
visit = [mainview]
while visit and consoleview is None:
v = visit.pop()
if v.isKindOfClass_(OMTextEditorView):
# main editor, skip it
continue
if v.isKindOfClass_(OMTextView):
consoleview = v
continue
visit += v.subviews()
return consoleview
or a similar search, but comparing classname strings:
def findConsoleView():
app = objc_util.UIApplication.sharedApplication()
mainwindow = app.keyWindow()
mainview = mainwindow.rootViewController().view()
consoleview = None
visit = [mainview]
while visit and consoleview is None:
v = visit.pop()
classname = str(v._get_objc_classname())
if classname == "OMTextEditorView":
# main editor, skip
continue
if classname == "OMTextView":
consoleview = v
continue
visit += v.subviews()
return consoleview
now, in Pythonista 3.3, neither of these methods is working...the class-object comparison doesn't match, and it doesn't find a view matching by classname either.
Anyone know where the console text view has gone?
I tried looking for all views with "Text" in the classname from the root view, as above, but there's no view that appears to contain the console text.