Re: Sherlock problems
Re: Sherlock problems
- Subject: Re: Sherlock problems
- From: Gary Lists <email@hidden>
- Date: Sun, 15 Jun 2003 21:09:38 -0400
On or about 6/15/03 5:40 PM, Russell Lindenschmidt wrote:
>
I am trying to get sherlock to automagically search eBay for a specific
>
item and return the set.
>
>
tell application "Sherlock"
>
activate
>
search Internet in channel "eBay" for "Mac OS X" with display
>
end tell
>
>
any ideas on how to get this to work? All it does is just pull up the
>
eBay channel.
>
>
Thanks,
>
>
Russ
Hi Russ.
Admittedly, the Sherlock dictionary is _very weak_ in descriptive
information, even about results returned. (Why does Apple insist on
half-assing their own software?)
At any rate, there are a couple of things about your script that you'll need
to change.
First off, "channel" is only one of the iconic channels shown in Sherlock.
'eBay' is, therefore, not a channel. It is, however, an "Internet search
site" (if you have the eBay sherlock plug-in installed.)
Internet search sites are _specifically_ the files contained in your
Internet Search Sites folder, of type 'issp' and/or extension '.src'.
You can see a list of these, via applescript, in the short sample script I
include below.
So, once you've committed to memory that "channel" is one of the folders in
your ISS folder -- shown in the alotted channel icons in Sherlock -- and
that "Internet search site" is _not_ a domain or URL string but the name of
one of the files in the ISS folder, then you're ready to roll with the
dictionary.
This sample script will ask the user for a query string, then present a list
of all the valid "internet search sites" installed on your computer[1], and
then do the search in the channel called "Internet" (the world icon in
Sherlock 2). (This assumes that the .src file is in the channel
'internet'...but
set query_terms to text returned of (display dialog "Search for what words?"
default answer "")
tell application "Sherlock 2"
set all_site_plugs to all search sites
-- show all plugs with no channel-checking
set this_plug to (choose from list all_site_plugs) as text
search Internet this_plug in channel "Internet" for query_terms
with[no-break] display
end tell
For you, then, you would select your 'ebay' plug in and also change the
'channel "Internet"' to whatever channel you have your eBay search plug
stored in. (for example, you might use: channel "My Channel")
I do have a much longer script that _really does_ let you select only from
search plug ins that are in the channel folder for the channel you choose,
if you want to see that.
HTH,
Gary
[1] Last year, when as I was finishing my SherlockQuery2HTML script, I
became very frustrated because the AppleScript code:
all search sites
returns a list of _not all_ of the installed search sites. I found it
difficult to script the collection of all the search site plugs installed,
which kept coming up as a count of '89' even when I packed the ISS folder
full of hundreds of them (not duplicates). My little droplet "count types
9X" reports that I now have 273 of these "valid" files.
<<class pals>> is the class of these files per AppleScript, and they should
have a Finder file type of 'issp' (creator 'fndf')
Without having absolutely concluded this to be true, I continued (and
continue) to operate on this principle:
all search sites installed into the Internet Search Sites folder...
1. should end in the extension ".src"
2. should be of type 'issp' [<-- no idea about OSX]
--
MacOS 9.1 / "9 is Fine"
OMM: osa:AS 183 / osa:JS 103 / FM 55 / BB 612 / Smile 188
______________________________________________________________
Please reply directly to the list.
Incoming messages are auto-deleted. (It's anti-spam, that's all.)
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.