Make Mori attachable

Project:Mori
Version:1.6.3
Component:Code
Category:feature
Priority:normal
Assigned:Alfonso Guerra
Status:active

Description

I understand mGTD started out as an AppleScript, and then turned into a plugin.
Would be nice to have a black box to do that, but there may not be one.
Converting a script to a plugin is way over my head, so I started looking for other ways to have a Mori script run automatically, like mGTD.
I found Prefab UI Actions, which does just that - run a script upon a change in the GUI.
Later I discovered that this is called 'attachability'. According to a page somewhere in Apple Developer Connection it is not too hard to implement.
So that is my request: a Mori plugin to make Mori attachable.

Updates

#1 submitted by Alfonso Guerra on Tue, 2008-06-24 15:28
Assigned to:» Alfonso Guerra

"Attachable" is Prefab Software's name for its functionality.

The actual mechanism is Apple's Accessibility API .

Most of Mori already supports this functionality, but the custom UI controls do not. Must correct this shortcoming.

#2 submitted by Alastor933 on Wed, 2008-06-25 04:15

To clarify: I know that for GUI scripting I must turn on 'support for assistive devices'. I have written a GUI script for Mori, and I do not know of any shortcoming of Mori in that respect.
From reading stuff on the Web I find that 'attachability' is considered a not well-defined property (non-Applescript meaning) of applications. I take it to mean that an attachable app can run a script when a specific action occurs in its windows or menus. This is nothing like sticking a script in Mori's toolbar. I just am re-reading Ted Neuburg's AppleScript book - he names BBEdit as an attachable application: you store a script (in a specific format) in a special folder, and it will run when you select the menu item it is attached to.

I apologise when I'm telling you things you already know, but your reply seems to imply you were thinking of GUI scripting. I was not. I thought it would be great to have a plugin that would allow mori to run scripts automatically. It would be watching the GUI, presumably, but is that GUI scripting?

#3 submitted by Alfonso Guerra on Wed, 2008-06-25 08:20

According to Apple, GUI Scripting is the ability to control, via AppleScript, applications that either do not have AppleScript support or are only partially scriptable. I suppose, but I'm not certain, that this is what you also mean by GUI Scripting; but this isn't what I was referring to in my earlier note.

Prefab Software's site describes attachability as the ability to attach AppleScripts to an application's UI, so that the scripts are executed in response to user actions in the app. Their software, UI Actions, provides a mechanism that brings attachability to apps that do not have this functionality.

You are correct that attachability doesn't require support of the Accessibility API, although Apokalypse products are required to have such support in any case.

On Apple's Developer Connection, the only information explaining attachability is in the MacApp docs, which is a framework Apple marketed for its long-abandoned Object Pascal programming language. However, additional information (also in an obsolete document) points out what is likely to be the underlying mechanism. The MacApp overview document also indicates that attachability offers the ability to attache scripts to any Apple event object, not just UI elements, which is far more powerful; so this feature will definitely be an addition to Mori as well.

#4 submitted by Alastor933 on Thu, 2008-06-26 02:02

So I got something right, for once...

But:
so this feature will definitely be an addition to Mori as well.
Are you saying you will actually add this to Mori?
You surely got my attention now!