> Is there a built-in way I'm just overlooking or a macro or
> something I can do that would allow me to accomplish this?
Easily done with a script:
-Dennis
If you turn it on BBEdit will select a whole line with a single click when the mouse is positioned at the very left end of a line. The editing cursor changes to a left pointing arrow.
It's really handy for worksheets when you want to execute a line but it would also work for a select, copy, paste, paste sequence.
--
--> So are we going to celebrate the start of a new decade at the end of this year? Or do the tens start at in January 2011? <--
> If you turn it on BBEdit will select a whole line with a single
> click when the mouse is positioned at the very left end of a line.
> The editing cursor changes to a left pointing arrow.
>
> It's really handy for worksheets when you want to execute a line but
> it would also work for a select, copy, paste, paste sequence.
______________________________________________________________________
Command-L == Select Line
Command-Option-L == Select Paragraph
--
Chris
Here are a couple of scripts I wrote that I use almost daily. I've mapped them to cmd-opt-up and cmd-opt-down. The line at the selection point or all lines that the current selection touches will be duplicated. The resulting selection will be the entire duplicated lines.
I also have corresponding scripts to move line(s) upwards and downwards, but they are a little bit buggy (I haven't been able to work around all edge case quirks) so I don't include them here, but they are mapped to cmd-ctrl-up/down.
----------------------------------------
-- Duplicate line(s) downwards
-- Johan Sölve 2008-12-20
tell application "BBEdit"
set selStart to (startLine of selection)
set selEnd to (endLine of selection)
set seloffset to (characterOffset of selection)
set selLength to (length of selection)
if selLength > 1 then
-- check if full lines are selected, in that case deselect the trailing linebreak
select (characters seloffset thru (seloffset + selLength - 2) of document 1)
if (endLine of selection) < selEnd then set selEnd to (endLine of selection)
else if selLength = 1 then
-- a single character can only be a single line, but a selected empty line looks like two lines, fix this
set selEnd to selStart
end if
set copylines to contents of (lines selStart thru selEnd) of document 1
-- insert after last line of selection
select insertion point after line selEnd of document 1
set selection to return & copylines
-- we have a new selection now, deselect the leading linebreak to make repeated duplicates work properly
set seloffset to (characterOffset of selection)
set selLength to (length of selection)
select (characters (seloffset + 1) thru (seloffset + selLength - 1) of document 1)
end tell
----------------------------------------
-- Duplicate line(s) upwards
-- Johan Sölve 2008-12-20
tell application "BBEdit"
set selStart to (startLine of selection)
set selEnd to (endLine of selection)
set seloffset to (characterOffset of selection)
set selLength to (length of selection)
if selLength > 1 then
-- check if full lines are selected, in that case deselect the trailing linebreak
select (characters seloffset thru (seloffset + selLength - 2) of document 1)
if (endLine of selection) < selEnd then set selEnd to (endLine of selection)
else if selLength = 1 then
-- a single character can only be a single line, but a selected empty line looks like two lines, fix this
set selEnd to selStart
end if
set copylines to contents of (lines selStart thru selEnd of document 1)
-- insert before first line of selection
select insertion point before line selStart of document 1
set selection to copylines & return
-- we have a new selection now, deselect the trailing linebreak to make repeated duplicates work properly
set seloffset to (characterOffset of selection)
set selLength to (length of selection)
select (characters seloffset thru (seloffset + selLength - 2) of document 1)
end tell
--
Johan Sölve [FSA Member, Lasso Partner]
Web Application/Lasso/FileMaker Developer
MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se mailto:jo...@montania.se
(spam-safe email address, replace '-' with 'a')
Highlight the line and Option Drag it.
>So are we going to celebrate the start of a new decade at the end of
>this year? Or do the tens start at in January 2011?
2011. There was no Year 0 (it went from 1 BCE/BC to 1 ACE/AD) so
decades run from xxx1 to xxx0). This is the same reason why the 21st
Century/ 3rd Millennium started in 2001 not (as many
thought/celebrated) in 2000 confusing the Year 2K computer problem
with the start/end of the Century/Millennium.
Before we get kicked off. . .
Was the year 0000 represented by Roman numeral I for the first year after the epoch?
If so is year MMX or MMIX ?
--
--> From the U S of A, the only socialist country that refuses to admit it. <--
>On 10/27/09, Robert A. Rosenberg wrote:
>>At 16:20 -0600 on 10/22/2009, Doug McNutt wrote about Re: Is there a
>>way to duplicate a line?:
>>
>>>So are we going to celebrate the start of a new decade at the end of
>>>this year? Or do the tens start at in January 2011?
>>
>>2011. There was no Year 0 (it went from 1 BCE/BC to 1 ACE/AD) so
>>decades run from xxx1 to xxx0). This is the same reason why the 21st
>>Century/ 3rd Millennium started in 2001 not (as many
>>thought/celebrated) in 2000 confusing the Year 2K computer problem
>>with the start/end of the Century/Millennium.
>
>This is true about no Year Zero. BUT the consequence is that the
>first century had only 99 years. Every other century has 100.
>Otherwise things aren't common sensical and pedants insist on
>arguing with history and popular culture.
>
>So, too, the decades would be wrong -- the Gay 90s would start in
>1891 and run to 1900.
The gay 90's refers to the years numbered 189x (ie: 1890-1899). It is
not the same as the 190'th decade (which is 1891-1900).
>The 50s, I think we can agree, run from 1950-1959, and if decades
>are to exist co-extensive within their centuries, then centuries
>need to start with the zero year, e.g., 1800, 1900, 2000.
The Decade/Century/Millennium is a 10/100/1000 year span and is
measured from the theoretical DAY 1 of the Year 1. They all end on
December 31 of the year numbered XXX0. This is the same difference as
measuring your age as years since your birthday (ie: Counting
Birthdays) vs years you have lived (counting from your birth - at Age
1 you are starting the 2nd year of your life).
>
>Everything works fine if you accept that the first century took the
>hit on the absence of Year Zero. That is where the problem started,
>so the problem should be solved where it occurred.
>
>It really makes sense and you'll avoid all that anguish if you
>accept that the first century (an artificial construct anyway) had
>only 99 years, since it was missing its Year Zero -- the rest of the
>centuries have theirs. This is a fact for the civil calendar, as
>opposed to the astronomical calendar.
>
>This is an issue in ancient calender studies, such as the Maya
>calendar, because calendar correlations, typically using Julian Day
>Numbers, need to know whether there is a Year Zero. Things have
>settled down mostly now, but for a while back in the 50s-80s
>(1950-1989!!) some major Mayanists got it wrong and messed up by a
>year looking forward or backward by including a Year Zero in their
>calculations.
You also have to take into consideration that in switching from the
Julian Calendar to the Gregorian Calendar in 1752, 11 days were
skipped (at least for England/the American Colonies) thus causing
Washington (who was born under the Old Style Calender) to not be born
on the date we celebrate as "Washington's Birthday. More days were
lost in counties that delayed the switch.
>
>Trust me...
>
>SU
Was the year 0000 represented by Roman numeral I for the first year after the epoch?
If so is this year, 2009, MMIX or MMX ?
--
--> A fair tax is one that you pay but I don't <--
On 06.11.2009, at 16:13, Johan™Strandberg wrote:
> If you are building a fence that is 100 feet long with one fence
> post every 10 feet, how many fence posts do you need?
>
> Obviously (if you are a programmer) 10 is not a good answer. 9 and
> 11 are acceptable answers.
For fence posts that don't add length to the fence (fence design
question), 11 is the only correct answer. 9 would only seem to be
acceptable to a programmer^[1] who knows that 10 can't be right, but
doesn't know anything about fences - specifically, that they need
posts at both ends.
For fences where the post contributes to the length of the fence, then
the correct answer depends on the width of the posts.
/ you were warned about pedantry.
mark.
[1]: a lot of non-programming engineers and scientists can be included
in this set.
Please consider this thread officially snipped.
Regards,
Patrick Woolsey
==
Bare Bones Software, Inc. <http://www.barebones.com>
P.O. Box 1048, Bedford, MA 01730-1048
>Darn fence posts...
>
>If you are building a fence that is 100 feet long with one fence
>post every 10 feet, how many fence posts do you need?
>
>Obviously (if you are a programmer) 10 is not a good answer. 9 and
>11 are acceptable answers.
9 is only a "correct" answer if you allow the use of 5ft rails for
the edges (which are not supported at the ends) ie:
-5-P-10-P-10-P...P-10-P-5- (where -5- and -10- are respectively
5ft/10ft rails and P is the post).
The correct answer (with posts at both ends) is 11:
P-10-P-10-P...P-10-P-10-P
--
Robert A. Rosenberg
RAR Programming Systems Ltd.
Home: 845-357-0931
Cell: 646-479-1984
Fax: 646-349-4025