On Aug 30, 2007, at 8:24 PM, Jim DeVona wrote:

When writing Applescripts for Yojimbo, the "selection" property
reports the currently selected database item[s]. However, if you
select a note item (for example) and click in the note text to edit
it, the selection is "missing value." The note clearly remains the
current item, and therefore seems as reasonable a target for scripting
as when the item list rather than the note text had focus. Is there an
Applescripty way to determine the id of the current item in these
circumstances?

The selection property on the application is an "alias" for the selection property on the front window.

The selection follows the user focus. When user focus is not in the collection or items list, there is no scriptable object selected, so asking for the selection property returns missing value to indicate this.

The scripting class of the main window is "browser window" and it has two additional properties which allow you to access the selected collection and selected items independent of the currently focused view. Run the following with the event log open:

tell application "Yojimbo"
        selection
        if class of window 1 is browser window then
                selected collections of browser window 1
                selected items of browser window 1
        end if
end tell

Jim


--
------------------------------------------------------------------
This message is sent to you because you are subscribed to
 the mailing list <[email protected]>.
To unsubscribe, send mail to: <[EMAIL PROTECTED]>
List archives:  <http://www.listsearch.com/yojimbotalk.lasso>
Have a feature request, or not sure if the software's working correctly? Please send mail to: <[EMAIL PROTECTED]>

Reply via email to