Re: Identifying current item when list pane does not have focus (Applescript)

2007-08-31 Thread Jim Correia

On Aug 31, 2007, at 12:22 PM, Jim DeVona wrote:

I find that as long as I specify "selected items of browser window  
1", I get the selected

items even if a non-browser window is window 1 or if the browser
window isn't even open. Referring to the "selected items of window 1",
on the other hand, only works if window 1 is a browser window.


That's correct. As long as the main window exists, "selected items of  
browser window 1" will always work even if some other window is  
frontmost.


Jim

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


Re: Identifying current item when list pane does not have focus (Applescript)

2007-08-31 Thread Jim DeVona
On 8/30/07, Jim Correia <[EMAIL PROTECTED]> wrote:

> 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

One question. Am I correct that checking the class of window 1 is
really only necessary if I ask for the selected collections or items
of "window 1", rather than "browser window 1"? I find that as long as
I specify "selected items of browser window 1", I get the selected
items even if a non-browser window is window 1 or if the browser
window isn't even open. Referring to the "selected items of window 1",
on the other hand, only works if window 1 is a browser window.

Jim

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


Re: Identifying current item when list pane does not have focus (Applescript)

2007-08-30 Thread Jim DeVona
On 8/30/07, Jim Correia <[EMAIL PROTECTED]> wrote:

> 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

Great! Thank you, Jim. Not sure how I missed those, but I'm happy to
have them pointed out. I expect I'll be able to improve my scripts
quite a bit with these properties.

Thanks again,
Jim

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


Re: Identifying current item when list pane does not have focus (Applescript)

2007-08-30 Thread Jim Correia

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 .
To unsubscribe, send mail to: <[EMAIL PROTECTED]>
List archives:  
Have a feature request, or not sure if the software's working 
correctly? Please send mail to: <[EMAIL PROTECTED]>


Identifying current item when list pane does not have focus (Applescript)

2007-08-30 Thread Jim DeVona
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?

Jim

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