On Sep 11, 2011, at 13:13, Robert M. Münch wrote:
> Sorry, I meant CMD+C... to copy the actual line without marking it first.
> Robert
______________________________________________________________________
Hey Robert,
Well. You can't attach to the 'Edit-->Copy' menu item, because it is disabled
if there is no selection. But you could put the attached script in the script
menu and give it the Cmd-C keyboard shortcut or a different one.
This script is not thoroughly tested but seems to be working correctly for
selection, no-selection-line-text-available, and
no-selection-no-line-text-available.
--
Best Regards,
Chris
______________________________________________________________________
tell application "BBEdit"
try
tell text of front text document
set selectedText to contents of selection
if selectedText = "" then
set lineText to contents of line (startLine of its selection)
if lineText ≠ "" then set the clipboard to lineText
else
set the clipboard to selectedText
end if
end tell
on error errMsg number errNum
set sep to "------------------------------"
set e to sep & return & "Error: " & errMsg & return & sep & return ¬
& "Error Number: " & errNum & return & sep
beep
display dialog e
end try
end tell
--
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>