Re: selected items whose class is bookmark item

2007-09-21 Thread J. Stewart
On 9/20/07 at 5:56 PM, Jim DeVona [EMAIL PROTECTED] spake thusly:

 Is it possible to use a whose clause to get only items of a certain
 type from a list of Yojimbo database items? Here is an example
 intended to get any selected bookmark items:
...
 This works for me.

 -- Cut --
 tell application Yojimbo
 set foo to every database item whose class is bookmark item
 end tell
 -- Cut --

Right, same here. However, I'm not after every bookmark item in
Yojimbo - just the bookmark items in a particular subset of the
library, such as the list of selected items.


The only way I know of is...

-- Cut --
set bar to {}
tell application Yojimbo
set foo to selection
repeat with anItem in foo
if class of (contents of anItem) is bookmark item then
set end of bar to (contents of anItem)
end if
end repeat
return bar
end tell
-- Cut --

-- 
Any government big enough to do things for you is big enough to do things to 
you.

--
--
This message is sent to you because you are subscribed to
  the mailing list yojimbo-talk@barebones.com.
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]


selected items whose class is bookmark item

2007-09-20 Thread Jim DeVona
Is it possible to use a whose clause to get only items of a certain
type from a list of Yojimbo database items? Here is an example
intended to get any selected bookmark items:

tell application Yojimbo

set _items to selected items of browser window 1
if _items is missing value then return

set _bookmarks to every item of _items whose class is bookmark item

end tell

The bookmarks line gives this error: 'Can't get {bookmark item id
D0303DFD-C8B1-4F17-BD0E-EAD40018D3A1 of application Yojimbo} whose
class = bookmark item.' I suspect I am either grossly off track or
nearly there. Any guidance?

Thanks,
Jim

-- 
--
This message is sent to you because you are subscribed to
  the mailing list yojimbo-talk@barebones.com.
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]