> Is there a way to attach an applescript to a menu-item that checks to see if there's a selection?
Yes, but it might be cleaner to solve your problem in a different way.
What, specifically, are you trying to do?
Steve
On Feb 1, 1:32 am, Oliver Taylor <olivertay...@me.com> wrote:Is there a way to attach an applescript to a menu-item that checks to see if there's a selection?
Yes, you can check the length of the selection to see if anything is connected and surround that with an if statement. I do it in a script that I run.
tell application "BBEdit"
tell front text window
if length of selection = 0 then
tell application "BBEdit"
tell text window 1
select line (startLine of selection)
end tell
change case selection of text window 1 making raise case with replacing target
end tell
else
tell application "BBEdit"
change case selection of text window 1 making raise case with replacing target
end tell
end if
end tell
end tell