![]() ![]() To use the GUI scripting (to detect AxWebAreas), one apparently has to talk to the app as a System Events process – which seems to disallow anything like close theWindow. It was a bit tricky to actually close the window. Return "Closed " &closedCount & " HTML output windows." Return "No HTML output windows to close." FIXME: This count is sometimes the expected value + 1 - why? ![]() Tell application "TextMate" to close window i Tell the first UI element of the first scroll area of window i Repeat with i from (count windows ) to 1 by - 1 - iterate backwards so indices don't shift on close ![]() Tell application "TextMate" to set answer to button returned of (display dialog "This command relies on the GUI scripting architecture of Mac OS X which is currently disabled." & return & return & "You can activate it by selecting the checkbox \"Enable access for assistive devices\" in the Universal Access preference pane." buttons default button 1 with icon 1 ) The command is a shell script that wraps this piece of AppleScript: set closedCount to 0 This is very useful, at least to me, when developing some TextMate commands – one can end up with tons of such windows. I wrote a TextMate command to close all HTML output windows: Close All HTML Output Windows.tmCommand. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |