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

[MacPerl] Shuck, AS, Perl, whatever, Pt 3.



Matthias Ulrich Neeracher,neeri@iis.ee.ethz.ch, writes:
: What Perl does is looking up the search key in the dbm file "MacPerl Help",
: which results in an URL that MacPerl sends off via Internet Config.

That was a first guess at how it worked, but after a peek with BBEdit into
"MacPerl Help" I thought better of it. This time I tried peeking with some
code and came up with this AppleScript:

tell application "BBEdit 4.0"
	set findstr to text of selection
end tell
tell application "MacPerl"
	set foo to Do Script ("use AnyDBM_File;$X = tie(%db,AnyDBM_File,'sys:MacPerl
Ä:MacPerl Help', 1, 0);&MacPerl'Reply($db{'" & findstr & "'});")  ---!long
line
end tell
tell application "Shuck"
	activate
	geturl "sys/MacPerl Ä/" & (characters 5 through -1 of foo)
end tell

Again there's an overlong line there that I hope is obvious. The above does
not rely on BBEdit's search, but does need MacPerl open, or launches it.
Again no error checking or comments and this time some ugly Perl code so it
fits on one line. I'll put both versions 2 and 3 in BBEdit's Scripts menu and
play around with them until I decide which is most convenient, or until a
better way to do this comes along.

: I could & should make this method available, probably by adding a "HELP"
: AppleEvent to MacPerl and/or Shuck, which should be a matter of a few
: minutes.

Yes, a 'lookup' event in Shuck, just implimenting the menu command, would be
great for this.

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