I've got a simple ruby text filter that underlines text (in Markdown/Setext 
style):

text = ARGF.read
counter = text.length
puts text
counter.times { print "-" }
p

And I want to attach a script to the menu item so that if there's no selection 
the line is selected, then the text filter runs. Here's the applescript:

on menuselect()
        tell application "BBEdit"
                tell front text window
                        if length of selection = 0 then
                                set cur_line to startDisplayLine of selection
                                try
                                        select display_line cur_line
                                end try
                        end if
                end tell
        end tell
        
        -- setting weHandledCommand to "true" cancels whatever the menu item 
was going to do
        set weHandledCommand to false
        return weHandledCommand
end menuselect

I've named the script "Apply Text Filter•Setext Single" (which corresponds to 
the text-filter name).

I can't seem to get this one working. Can anyone help me?

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>



Reply via email to