August 20, 2010

Cleaning up Windows in a non-Scriptable Application

Here is an example of using User Interface scripting in Applescript to move windows around in an application that is not otherwise scriptable. Through UI Scripting you can do some limited interface tasks with an app that you otherwise have no access to. For even the worst applications in terms of scriptability, UI Scripting can provide access to things like windows that are open, their size and their position.
In the script, once I have collected an array of all open windows in an app, a series of "if" boolean statements are used to detect which window I'm now working with. Some of them have a title property that can be tested for, while others have a fixed window size that can be checked.

This example uses the Accordance application. Accordance has custom window classifications that do not respond to any "clean up windows" menu command. The app is not scriptable, and due to the custom nature of its user interface, the properties that UI scripting has access to are extremely limited. Windows can get moved around when connecting/disconnecting external displays. This app rearranges the windows how you would like them.

Here is the text of the script, and you can find a link to the script on the Downloads page. (On how to integrate such a script into your own workflow, look elsewhere on this blog or google Applescript to your hearts content.)



-- Clean up Accordance windows  v.1
-- This script will move the first main search window to the top left, and then move all palettes to the edges of the main display
-- Will have to be adjusted to meet your tastes and your external display setup.

tell application "Finder"
set screenBounds to bounds of window of desktop
set screenWidth to item 3 of screenBounds
set screenHeight to item 4 of screenBounds
end tell

tell application "Accordance" to activate
delay 0.5
tell application "System Events"
tell process "Accord"
set winCount to count windows
repeat with n from 1 to winCount
set thisWindow to window n
set winSize to size of thisWindow
set sw to item 1 of winSize
set sh to item 2 of winSize
set winPosition to position of thisWindow
set pw to item 1 of winPosition
set ph to item 2 of winPosition
if description of thisWindow is "dialog" then
-- it is a main search window
-- move to top left
set position of thisWindow to {1, 22}
else if size of thisWindow is {96, 552} then
-- it is a Resource palette
-- move to top right
set position of thisWindow to {(screenWidth - sw), 22}
else if size of thisWindow is {324, 46} then
-- it is a Text palette
-- move to middle bottom
set position of thisWindow to {(screenWidth / 2), (screenHeight - sh)}
else if ((get title of thisWindow) as string) is "Highlight" then
-- it is a Highlight palette
-- move to bottom right
set position of thisWindow to {(screenWidth - sw), (screenHeight - sh)}
else if ((get title of thisWindow) as string) contains "Keyboard Characters" then
-- it is a Character palette
-- move to top middle
set position of thisWindow to {(screenWidth / 2), 22}
else if ((get subrole of thisWindow) as string) is "AXFloatingWindow" then
-- is a palette, so only option left is Instant Details palette
-- move to bottom left
set position of thisWindow to {1, (screenHeight - sh)}
else
-- Must be another main search window
-- Can check for title, etc. to move them.
end if
end repeat
end tell
end tell

August 03, 2010

Still No Hebrew for Word 2011

The chatter has increased day by day as the MacBU got closer to releasing detail on Microsoft Office 2011 for Mac. We hear officially this morning that there is no support for right-to-left Unicode languages (Hebrew, Arabic, Aramaic). This is disappointing, and was my suspicion. Here is what they say:

With each version of Office for Mac we have to prioritize updates.  While we will be adding new language support there will not be full right-to-left support for languages such as Arabic and Hebrew. 
Office 2011 relies on the Apple Type Services for Unicode Imaging (ATSUI) as the set of services for rendering Unicode. Due to technology restraints on the text input tools, Office for Mac’s Unicode support doesn’t include languages such as Hebrew and Arabic.
We understand support for RTL languages is needed and it is something we have on our priority list. However, at this time, we don’t have any updates on timing. 


One bit of it is hogwash. It relates to the fact that they indeed did not rebuild Office using Cocoa. 
And as it stands now, there may be a silver lining. There was some previous success in pasting in, though not editing Unicode Hebrew into the last iteration of Word. From some beta testers I have spoken with, it appears that if one is working from a document created in another application that does have right-to-left Unicode that you can have more success. 
One tester responds with this tweet:

Yes I did, when I edit an Arabic file it works perfect, but it doesn't if I create a new doc!

And another stated this way:
About Arabic support in MS office 2011 Beta 5 for Mac: 1-Word:YES if you open an Arabic doc 2-Excel:NO AT ALL 3-Power Point:YES PERFECT
Aug
The big disappointment is that Hebrew is not supported. However, we will begin to get more information on just what is possible. Microsoft's troubles will only increase as they continue to neglect this problem.




July 22, 2010

Accordance on the iPhone

Today the folks at OakTree Software, makers of Accordance Bible Software, released a screenshot of the current Accordance iOS (iPhone) app due out this Fall. The impending release will be cause for great excitement from many users, myself included. I have been using OliveTree Bible Software on my mobile device for nearly a decade, and it is rocking good on the iPhone. I have a basic set of Greek tools on it, so it will be interesting to see how Accordance's app stacks up once it hits the app store and we get a chance to see it.

I recall at last year's SBL, following the "bible software smackdown," that folks were impressed just what was possible with a mobile app when Olive Tree's Bible Reader had a go at the challenge. What it could do was impressive because the presumed limitations had expectations quite low. This will be a new context. Accordance is bible software whose sophistication and capabilities is unrivaled. This creates a difficult situation where the inevitably limited functionality of a first release will be easy to find disappointing. For this reason, it is lamentable that the Accordance hat won't land in the ring until relatively late in the game.

That said, despite whatever capabilities Olive Tree's Bible Reader has possessed over the years on my portable device, I rarely use it for anything but reading the bible, and rarely a simple search. This is precisely the basic functionality Accordance has told us to expect. I suspect many, many current Accordance users are thrilled to soon be able to simply read their Accordance modules on their iPhones. Fun times ahead.

June 08, 2010

Office for Mac 2011 Not All Cocoa

On the Office for Mac Team Blog, it was confirmed today that they are behind in writing all the components of Microsoft Office for Mac in Cocoa. For the Office 2011 release, the new Ribbon and Outlook will be written in Cocoa, but the remainder of the apps will not. This does not bode well for Word, and its compatibilities for things such as OSX Services. Still no word on Unicode R-t-L Hebrew either.

June 02, 2010

SBL Annual Meeting Presentation

The preliminary program book is online for the annual meeting of the Society of Biblical Literature in Atlanta. I will be presenting some of my dissertation findings in a synoptics section:

Synoptic Gospels
11/21/2010
4:00 PM to 6:30 PM
Theme: Revisiting Classic Interpretations

Robert Derrenbacker, Thorneloe University, Presiding

Peter Wick, Ruhr-University of Bochum
The Unspeakable Mysterion in Mark and the Unveiled Mysteria in Matthew and Luke (30 min)
Jason Robert Combs, University of North Carolina at Chapel Hill
Jewish 'Fools' and their Gentile Foil: Reading Comedy in Mark 15:34-39 (30 min)
Rebekah Eklund, Duke University
The Identity of the Crowds in the Passion Narrative (30 min)
Elizabeth E. Shively, Gordon-Conwell Theological Seminary
A Tale of Two Households: Mark 3:22-30 and 13:32-37 (30 min)
Joseph Weaks, Brite Divinity School
Reconstructing Mark: Problems With Getting Behind the Text (30 min)

Here's the abstract:
Reconstructing Mark: Problems With Getting Behind the Text
In Synoptic Studies, often the examination of a pericope includes our attempts to get behind the text. We rely upon standard criteria for reconstructing source texts. However, we need to improve our capability to assess the reliability of a text that has been reconstructed from potentially independent witnesses that used it as a source. For example, how well could we reconstruct Mark based upon its use in Matthew and Luke? This paper will survey the findings of a dissertation which established a complete reconstruction of Mark from the evidence in Matthew and Luke. The results come from structural analysis and a comparative stylographic statistical comparison between the fully reconstructed Mark and the canonical text of Mark. Assessing what is lost in the reconstruction, what is introduced, and what is changed in relation to canonical Mark helps us understand the limitations of source analysis within the Synoptic gospels. Among the findings is the recognition that a reconstructed text will not reflect many of the dominant features of its predecessor, and likewise, a reconstructed text will bear features unique to its form that have no relevance to the original text it approximates. These findings point to strong implications for how we assess the primitivity of one tradition against another, the presumptions made regarding an underlying textual form of a given pericoope, as well as the reliability of the text of a reconstructed Q source as it is used in other historical inquiry into early Christianity.