[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Perl, Shuck, AS, BBEdit pt. 2



I've found a way around the limitations I encountered yesterday. What I've
done is used BBEdit to pre-search the POD files, then used it's results to
tell Shuck what to look for. The AS looks like this - note the long line (I
could add AS continuation characters to break it up but some mailers might
not like them).

tell application "BBEdit 4.0"
	set findstr to text of selection
	find ("=item " & findstr) starting at "sys:MacPerl Ä:pod2:"
	set foo to "sys:MacPerl Ä:pod:perlfunc.pod#" & (characters 7 through -1 of
(item 5 of (items of (record 1 of result))) as text) ---!long line
end tell
tell application "Shuck"
	activate
	geturl foo
end tell
foo

Also note that I use a different directory for the initial search, which
currently contains only perlfunc.pod, as this makes the initial search take
only a fraction of a second instead of a couple of seconds and lets me narrow
the search to just perlfunc.pod. I will probably copy more files to this
directory and may create further directories, using multiple copies of this
script to do "lookup function", "lookup module", etc., depending on how I
find this works.

I've only tested the script with BBEdit 4.0.2, as I'm avoiding 4.0.3 until
its AS bugs are worked out. It could do with some more error checking, or
even comments, but I'm too lazy to do anything about this now.

John
--
John Blackburne - programmer, writer, consultant, trainer
Perl, AS, QD3D and more at http://www.hk.super.net/~johnb