AppleWorks 6: selecting tools in spreadsheet documents/exit text mode

I’m writing a script to extract data out of a batch of almost five thousand AppleWorks spreadsheet documents (i.e. invoices).
the invoices were created from an AW template that includes a text field.

everything works fine until the script encounters a document that has been saved with the text field active (meaning: the text tool is selected, with the text cursor blinking in the text field).
I tried everything to select the spreadsheet tool (top right in the tool window).
I tried selecting the tool directly in AW, GUI scripts to select the tool, click by location in the tool window, click by location in AppleWorks etc.
I even tried to get the script to click twice on a cell in the spreadsheet part of the document (which under normal circumstances selects the spreadsheet tool automatically).
the PreFab UI browser only sees the tool window and does not see the individual buttons.
I’m not sure whether I just address my selection commands wrongly or at the wrong process, event or window.

ideally, I would also love to extract info out of the text field, but at this point I would just be happy to get all the other info out without headaches.
(for now, I just included a pause of 2 seconds in the script after it opens a document to allow the user to click twice in a cell to activate the spreadsheet tool)

any pointers are highly appreciated.

I also have a little extra question: is there a limit of levels that can be addressed in AppleWorks through a GUI script??


I have not scripted the SS portion of AW much, I do work a lot with the DB portion, so I am familiar with many of the AW scripting idiosyncracies.

Have you tried to access the offending cell(s) directly by pointing your script at cell B6 or whatever the problem cell is?

I honestly believe this is a solvable issue. I would be happy to play around with it this weekend if you want to send me some of your invoice files and what you have scripted so far. My email address is

Good luck