Re: QuickCursor (aka Edit in BBEdit anywhere)

2012-04-06 Thread KG
QuickCursor is awesome but If you want a similar solution with Keyboard 
Maestro, written a version 
here: 
http://journal.kaush.co/500/open-with-bbedit-aka-quickcursor-using-keyboard-maestro

Obviously lacks the polish of QuickCursor, but with KM you can get a more 
customized solution. Also this should work with any other application too 
including Mail. 


Cheers.

On Friday, January 7, 2011 6:47:13 PM UTC+3, TJ Luoma wrote:

 There is a new app available called QuickCursor which will allow you
 to edit text in *any* editable field using BBEdit.

 If you have ever wished that you could use BBEdit to edit text in
 other applications, but found it was a pain to open the document in
 one app, copy it app, paste it to BBEdit, make your changes, and then
 paste it back into the original app, this is for you.

 Do you ever edit text in a CMS? Ever lost work because the browser
 crashed on you and you hadn't saved your work? With QuickCursor you
 can save in BBEdit as often as you like. It waits until you close the
 BBEdit window before pasting the text back to the original app (and if
 for some reason it can't get it back to the original app, it throws up
 an immediate alert and puts the text on the clipboard so it won't be
 lost.

 You can see a (40 second) screencast here (be sure to make it
 full-screen so you can actually see what's happening):

 http://www.hogbaysoftware.com/products/quickcursor

 on the Mac App Store here:

 http://itunes.apple.com/us/app/quickcursor/id404035899?mt=12

 I am absolutely unrelated to the app in any way except that when I saw
 the screencast back in November, I begged for an early version, have
 been using it since then, and absolutely love it. It was my first Mac
 App Store purchase (as in, I had a free version of it and I then paid
 $5 for it) and I included it in my favorite apps of 2010:

 http://www.tuaw.com/2010/12/23/the-best-mac-applications-i-used-in-2010

 I thought it might be of-interest to folks here.

 TjL

 ps - it apparently works with something called other text editors too :-)



-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Insert Next List Item

2012-03-30 Thread KG
Rock on Sir !

On Wednesday, March 28, 2012 1:56:11 PM UTC+3, Kendall Conrad wrote:

 For anyone that was waiting, I did update the script to include handling 
 of + listed items. I also added . I made some other enhancements too while 
 I was at it. The numerical listing handles both going 3. to 4., but also 
 2.4. to 2.5. so it handles decimal numbering or sub sections. Lastly, I 
 added HTML list item support; it creates a li tags, copies the li tag's 
 attributes from the current line, and duplicates them and also places the 
 cursor inside the tag.

 If you have visited the page before you'll likely need to hit refresh to 
 ensure you're seeing the latest page updates. I haven't had a chance to do 
 thorough testing so if you see issues or have other suggestions let me know.

 http://www.angelwatt.com/words/2011/04/11/bbedit-smart-newline-open-line/

 -Kendall

 On Tuesday, March 27, 2012 9:50:05 AM UTC-4, Kendall Conrad wrote:

 The link I provided does have the latest code. If you visited the page 
 somewhat recently you may need to do a refresh to see the latest changes. 
 The code will state that is was last updated March 26 at the top of the 
 code listing.

 The updated code does handle doing lists that start with *, #, and -, but 
 not +. I thought about it, but couldn't think of anytime I've seen it used. 
 It would be very easy to add though to the code. Just edit the section 
 Check for lists and add \\+ to the two regex finds. It has to be escaped 
 since it's a special character for regex. I'll make an update when I get a 
 chance, probably within the next 20 hours.

 -Kendall

 On Tuesday, March 27, 2012 2:18:19 AM UTC-4, KG wrote:

 @Kendall : just one more thing, can you provide a link to the latest 
 source. from the url you provided i don't see the numbered list edit that 
 you said you made

 Thanks

 On Tuesday, March 27, 2012 5:14:31 AM UTC+3, Kendall Conrad wrote:

 My Smart Newline script can achieve this. You can examine the code 
 near the top to see how I capture to white space at the start of the 
 line if that's all you care about. I also updated the script this 
 evening to also handle numbered lists, which was part of the original 
 discussion question, though this is a little late for that I suppose, 
 but others might find it useful. 


 http://www.angelwatt.com/words/2011/04/11/bbedit-smart-newline-open-line/ 

 -Kendall 

 On Mar 26, 4:45 pm, KG for...@kaush.co wrote: 
  Hey Christopher, 
  
  Just a minor request to your existing script. This works 
 fantastically if 
  you line starts with the bullet. Assuming you have some indentation 
 like 4 
  tab stops and then the bullet, the script stops. I made a couple of 
 mods to 
  the script as follows: 
  
  
 ---
  

  tell application BBEdit 
  try 
  tell text of front text window 
  set lineOfInsertionPoint to line (startLine of 
 selection) 
  set findReco to find ^\\d+\\. searching in 
  lineOfInsertionPoint options {search mode:grep} 
  if found of findReco = true then 
  set leadingNumber to text 1 thru -2 of (found 
 text of 
  findReco) 
  set text of selection to return  (leadingNumber 
 + 1)  
  .  
  select insertion point after selection 
  else if found of findReco = false then 
  set findReco to find ^\\*  searching in 
  lineOfInsertionPoint options {search mode:grep} 
  if found of findReco = true then 
  set text of selection to return  *  
  select insertion point after selection 
  else 
  set findReco to find ^\\s*\\+ searching in 
  lineOfInsertionPoint options {search mode:grep} 
  if found of findReco = true then 
  
  set text of selection to return  tab  
 +  
  select insertion point after selection 
  end if 
  end if 
  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 
  
 ---
  

  
  Essentially the \s* helps ignore white space at the beginning. 
 There's just 
  one problem with my script. It inserts the new bullet point ignoring 
 the 
  previous number of tab stops. Is there a way in applescript to get 
 hold of 
  the number of tab stops and insert that at the beginning as well? 
  
  Thanks again

Re: Insert Next List Item

2012-03-27 Thread KG
@Kendall : just one more thing, can you provide a link to the latest 
source. from the url you provided i don't see the numbered list edit that 
you said you made

Thanks

On Tuesday, March 27, 2012 5:14:31 AM UTC+3, Kendall Conrad wrote:

 My Smart Newline script can achieve this. You can examine the code 
 near the top to see how I capture to white space at the start of the 
 line if that's all you care about. I also updated the script this 
 evening to also handle numbered lists, which was part of the original 
 discussion question, though this is a little late for that I suppose, 
 but others might find it useful. 

 http://www.angelwatt.com/words/2011/04/11/bbedit-smart-newline-open-line/ 

 -Kendall 

 On Mar 26, 4:45 pm, KG for...@kaush.co wrote: 
  Hey Christopher, 
  
  Just a minor request to your existing script. This works fantastically 
 if 
  you line starts with the bullet. Assuming you have some indentation like 
 4 
  tab stops and then the bullet, the script stops. I made a couple of mods 
 to 
  the script as follows: 
  
  
 ---
  

  tell application BBEdit 
  try 
  tell text of front text window 
  set lineOfInsertionPoint to line (startLine of 
 selection) 
  set findReco to find ^\\d+\\. searching in 
  lineOfInsertionPoint options {search mode:grep} 
  if found of findReco = true then 
  set leadingNumber to text 1 thru -2 of (found text 
 of 
  findReco) 
  set text of selection to return  (leadingNumber + 
 1)  
  .  
  select insertion point after selection 
  else if found of findReco = false then 
  set findReco to find ^\\*  searching in 
  lineOfInsertionPoint options {search mode:grep} 
  if found of findReco = true then 
  set text of selection to return  *  
  select insertion point after selection 
  else 
  set findReco to find ^\\s*\\+ searching in 
  lineOfInsertionPoint options {search mode:grep} 
  if found of findReco = true then 
  
  set text of selection to return  tab  +  
  select insertion point after selection 
  end if 
  end if 
  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 
  
 ---
  

  
  Essentially the \s* helps ignore white space at the beginning. There's 
 just 
  one problem with my script. It inserts the new bullet point ignoring the 
  previous number of tab stops. Is there a way in applescript to get hold 
 of 
  the number of tab stops and insert that at the beginning as well? 
  
  Thanks again. 
  
  
  
  
  
  
  
  On Monday, August 8, 2011 7:04:04 AM UTC+3, Christopher Stone wrote: 
  
   On Aug 07, 2011, at 21:35, oliver wrote: 
  
   I'm thinking it might have to be an AppleScript to select the line and 
   then call a Text Filter to handle finding the number/star and 
 appending the 
   next one... but my kung fu is not strong enough to figure it out. 
  
   __ 
  
   Hey Oliver, 
  
   This is very quick and dirty, but it'll work with the numerical 
 increment 
   and the asterisk bullet. 
  
   It's expecting the insertion point (cursor) to be at the end of the 
 line, 
   but it could easily be adjusted so that anywhere in the line would do. 
  
   You can put it in the script menu and give it a keyboard shortcut and 
 go 
   to town. 
  
   The logic is pretty straightforward, so you can add more characters 
 like 
   '•' to the mix if desired. 
  
   -- 
   Best Regards, 
   Chris 
  
   __ 
  
   tell application BBEdit 
 try 
   tell text of front text window 
 set lineOfInsertionPoint to line (startLine of selection) 
 set findReco to find ^\\d+\\. searching in 
 lineOfInsertionPoint 
   options {search mode:grep} 
 if found of findReco = true then 
   set leadingNumber to text 1 thru -2 of (found text of 
 findReco) 
   set text of selection to return  (leadingNumber + 1)  .  
   select insertion point after selection 
 else if found of findReco = false then 
   set findReco to find ^\\*  searching in lineOfInsertionPoint 
   options {search

Re: Insert Next List Item

2012-03-27 Thread KG
@Kendall : neat script. thanks again. 

@Kendall+Watts: One additional request-can the scripts be modified to pick 
the first character on the line and then use that as a bullet? for e.g any 
of the following could be bullets in my MD document (+,-,*). I have 
currently modified your scripts to take care of this, but rather than an 
if,else,if,else I thought it would be really cool to have the script 
automatically pick up the bullet character and insert.

Cheers and thanks for the great scripts.

On Tuesday, March 27, 2012 5:14:31 AM UTC+3, Kendall Conrad wrote:

 My Smart Newline script can achieve this. You can examine the code 
 near the top to see how I capture to white space at the start of the 
 line if that's all you care about. I also updated the script this 
 evening to also handle numbered lists, which was part of the original 
 discussion question, though this is a little late for that I suppose, 
 but others might find it useful. 

 http://www.angelwatt.com/words/2011/04/11/bbedit-smart-newline-open-line/ 

 -Kendall 

 On Mar 26, 4:45 pm, KG for...@kaush.co wrote: 
  Hey Christopher, 
  
  Just a minor request to your existing script. This works fantastically 
 if 
  you line starts with the bullet. Assuming you have some indentation like 
 4 
  tab stops and then the bullet, the script stops. I made a couple of mods 
 to 
  the script as follows: 
  
  
 ---
  

  tell application BBEdit 
  try 
  tell text of front text window 
  set lineOfInsertionPoint to line (startLine of 
 selection) 
  set findReco to find ^\\d+\\. searching in 
  lineOfInsertionPoint options {search mode:grep} 
  if found of findReco = true then 
  set leadingNumber to text 1 thru -2 of (found text 
 of 
  findReco) 
  set text of selection to return  (leadingNumber + 
 1)  
  .  
  select insertion point after selection 
  else if found of findReco = false then 
  set findReco to find ^\\*  searching in 
  lineOfInsertionPoint options {search mode:grep} 
  if found of findReco = true then 
  set text of selection to return  *  
  select insertion point after selection 
  else 
  set findReco to find ^\\s*\\+ searching in 
  lineOfInsertionPoint options {search mode:grep} 
  if found of findReco = true then 
  
  set text of selection to return  tab  +  
  select insertion point after selection 
  end if 
  end if 
  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 
  
 ---
  

  
  Essentially the \s* helps ignore white space at the beginning. There's 
 just 
  one problem with my script. It inserts the new bullet point ignoring the 
  previous number of tab stops. Is there a way in applescript to get hold 
 of 
  the number of tab stops and insert that at the beginning as well? 
  
  Thanks again. 
  
  
  
  
  
  
  
  On Monday, August 8, 2011 7:04:04 AM UTC+3, Christopher Stone wrote: 
  
   On Aug 07, 2011, at 21:35, oliver wrote: 
  
   I'm thinking it might have to be an AppleScript to select the line and 
   then call a Text Filter to handle finding the number/star and 
 appending the 
   next one... but my kung fu is not strong enough to figure it out. 
  
   __ 
  
   Hey Oliver, 
  
   This is very quick and dirty, but it'll work with the numerical 
 increment 
   and the asterisk bullet. 
  
   It's expecting the insertion point (cursor) to be at the end of the 
 line, 
   but it could easily be adjusted so that anywhere in the line would do. 
  
   You can put it in the script menu and give it a keyboard shortcut and 
 go 
   to town. 
  
   The logic is pretty straightforward, so you can add more characters 
 like 
   '•' to the mix if desired. 
  
   -- 
   Best Regards, 
   Chris 
  
   __ 
  
   tell application BBEdit 
 try 
   tell text of front text window 
 set lineOfInsertionPoint to line (startLine of selection) 
 set findReco to find ^\\d+\\. searching in 
 lineOfInsertionPoint 
   options {search mode:grep} 
 if found of findReco = true

Re: Insert Next List Item

2012-03-26 Thread KG
Hey Christopher,

Just a minor request to your existing script. This works fantastically if 
you line starts with the bullet. Assuming you have some indentation like 4 
tab stops and then the bullet, the script stops. I made a couple of mods to 
the script as follows:

---
tell application BBEdit
try
tell text of front text window
set lineOfInsertionPoint to line (startLine of selection)
set findReco to find ^\\d+\\. searching in 
lineOfInsertionPoint options {search mode:grep}
if found of findReco = true then
set leadingNumber to text 1 thru -2 of (found text of 
findReco)
set text of selection to return  (leadingNumber + 1)  
. 
select insertion point after selection
else if found of findReco = false then
set findReco to find ^\\*  searching in 
lineOfInsertionPoint options {search mode:grep}
if found of findReco = true then
set text of selection to return  * 
select insertion point after selection
else
set findReco to find ^\\s*\\+ searching in 
lineOfInsertionPoint options {search mode:grep}
if found of findReco = true then

set text of selection to return  tab  + 
select insertion point after selection
end if
end if
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
---


Essentially the \s* helps ignore white space at the beginning. There's just 
one problem with my script. It inserts the new bullet point ignoring the 
previous number of tab stops. Is there a way in applescript to get hold of 
the number of tab stops and insert that at the beginning as well?

Thanks again.


On Monday, August 8, 2011 7:04:04 AM UTC+3, Christopher Stone wrote:

 On Aug 07, 2011, at 21:35, oliver wrote:

 I'm thinking it might have to be an AppleScript to select the line and 
 then call a Text Filter to handle finding the number/star and appending the 
 next one... but my kung fu is not strong enough to figure it out.

 __

 Hey Oliver,

 This is very quick and dirty, but it'll work with the numerical increment 
 and the asterisk bullet.

 It's expecting the insertion point (cursor) to be at the end of the line, 
 but it could easily be adjusted so that anywhere in the line would do.

 You can put it in the script menu and give it a keyboard shortcut and go 
 to town.

 The logic is pretty straightforward, so you can add more characters like 
 '•' to the mix if desired.

 --
 Best Regards,
 Chris

 __


 tell application BBEdit
   try
 tell text of front text window
   set lineOfInsertionPoint to line (startLine of selection)
   set findReco to find ^\\d+\\. searching in lineOfInsertionPoint 
 options {search mode:grep}
   if found of findReco = true then
 set leadingNumber to text 1 thru -2 of (found text of findReco)
 set text of selection to return  (leadingNumber + 1)  . 
 select insertion point after selection
   else if found of findReco = false then
 set findReco to find ^\\*  searching in lineOfInsertionPoint 
 options {search mode:grep}
 if found of findReco = true then
   set text of selection to return  * 
   select insertion point after selection
 end if
   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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Migrating from TextMate to BBEdit

2012-03-18 Thread KG
In the spirit of sharing again, I've written some macros with Keyboard 
Maestro that try to emulate Textmate's Auto-pairing / matching. 

Details in my blog post 
: 
http://journal.kaush.co/453/true-textmate-like-auto-pairing-with-bbedit-using-keyboard-maestro

Cheers.

On Tuesday, July 27, 2010 10:34:54 AM UTC+3, Roland Küffner wrote:


 Am 27.07.2010 um 03:54 schrieb Toadling:

  On Jul 16, 2010, at 5:47 AM, Konstantinos Pachnis wrote:
  
  In TextMate there is feature Column Movement / Typing that you can 
 select a column data and then start typing to type on each line. Can this 
 be done in BBEdit?
  
  I think the closest you'll get to that in BBEdit is the Text - 
 Prefix/Suffix Lines... command. Assign a key combination to it and trigger 
 it to bring up a sheet with options to add or remove prefixes and suffixes 
 for all selected lines.

  Additional you can make a rectangular selection in BBEdit (hold Alt 
 while selecting, make sure Soft Wrap is turned off) and paste the content 
 of the clipboard to each line at the selected position. Again, this is not 
 as fancy as in TextMate but does the job.


  When I select a string (word, line, etc…) can I enclose it in between 
 parentheses, quotes, square brackets, etc… by just typing the character?
  Using a language mapping (ruby, c++, etc…), is it possible when opening 
 a parentheses, square bracket, etc… to insert the corresponding close 
 character?
  
  The best way I've found to simulate this behavior is to use BBEdit's 
 clippings feature. I created a bunch of clippings to insert the opening and 
 closing characters with the cursor positioned between them (and any other 
 text I want). I then assigned keyboard shortcuts to them. For example, 
 Control-Command-[ gives me a pair of square brackets with my cursor in 
 between ready for input.
  
  Again, maybe not as fancy as TextMate's auto-matching pairs, but I do 
 find I get fewer accidental, unwanted closing parens and brackets with the 
 clipping method in BBEdit.


 Be sure to check out the Clipping feature in the manual. It is one of 
 BBEdit's best features. You would miss a lot of functionality that makes 
 BBEdit such a decent editor. For example the syntax for adding 
 parenthesises to a selection is:
 #selstart#(#select#)#selend#
 With an assigned keyboard shortcut this is pretty nice. You can further 
 tweak BBEdit with little applescripts that make your editing life easier. 
 One of my favorites is Select Word (by John Gruber if I remember that 
 right):

 tell application BBEdit
 tell window 1
 set sel_offset to characterOffset of selection
 set cur_line to startDisplayLine of selection
 try
 select (last word of display_line cur_line ¬
 whose characterOffset ≤ sel_offset)
 on error
 select display_line cur_line
 end try
 end tell
 end tell


 This group is a good ressource for little bits. You'll find a lot of 
 solution to specific problems. Searching the archives is strongly 
 recommended.

 Happy editing
 Roland



-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Auto format/insert markdown formatted bulleted points

2012-03-17 Thread KG
nValt, a fork of Notational velocity has this pretty neat feature, where if 
i have bulleted list i'm writing in markdown e.g:

+ this is the first point
+ this is the 2nd point
+ this is the 3rd point | cursor position


at Cursor position, if i hit the enter key, it automatically indents to 
that position and inserts the bullet (+). Is there some way of achieving 
this with BBEdit Clippings?

Currently BBEdit has no problems indenting, but a feature where it 
recognizes the bullet and auto inserts it would be totally wicked.

Cheers.


-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


auto insert next point in Markdown formatted list

2012-03-17 Thread KG
*(reposting cause not sure if my previous post went up. thank you new 
google groups!)*

nValt 2.2 has this really cool feature where if you have a markdown list 
like so:

+ point 1 something
+ point 2 something more
+ point 3 woh.. | cursor position


hitting the enter key at the cursor position automatically indents to the 
right level and auto inserts + to start the next bullet. BBEdit currently 
does the auto-indenting part stupendously, but is there a clipping of sorts 
that can be written so that BBEdit also recognizes the bullet and inserts 
that? That would be totally wicked.

Cheers.

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Auto format/insert markdown formatted bulleted points

2012-03-17 Thread KG
u the man Chris!

On Saturday, March 17, 2012 10:19:10 PM UTC+3, Christopher Stone wrote:

 On Mar 17, 2012, at 13:56, KG wrote:
  nValt, a fork of Notational velocity has this pretty neat feature, where 
 if i have bulleted list i'm writing in markdown e.g:
 __

 Hey There,

 This sort of thing is possible.  Scope out this thread:


 https://groups.google.com/group/bbedit/browse_frm/thread/7a02b6f41f690f6b/e2dd06564a1420ac?lnk=gstq=This+is+very+quick+and+dirty#e2dd06564a1420ac

 --
 Best Regards,
 Chris




-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit