Customising matching brackets functionality
Hi all, One of the most often used features for me is command-B, finding matching brackets which does a great job with (, [ and {... however, I often also would like to find matching command statements as some of the languages I program in don't use brackets but FOR ENDFOR etc statements. Is it possible to create a custom set of matching word terminators? i.e. make it recognise FOR as the opening bracket to a ENDFOR closing bracket ? I'm still on version 9.6.3, so if 10 can do it, a reason for an upgrade! Cheers - Balt -- 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
AppleScript Get contents of lines
I'm working with various selections in a document, and at times the line immediately following the selection needs to be read into a variable for future comparison. Thus, let's say the two below columns represent two different files. This This is is data data x y Let's say my selection encompasses This is data in both files. But, the following line is different. Thus, I can use Applescript to get the lines of selection + 1 to get the line number. I am having difficulty getting the contents of the + 1 line since it isn't part of selection. Any suggestions? Thanks. -- 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
PageUp/PageDown does not work properly in 10.1.1
Hi there, It looks like version 10.1.1 does not have working PageUp/PageDown functionality, which is kind-of unexpected for such advanced text editor. Option+up/down just move cursor to top/bottom line (which is useless btw) instead of jumping up or down one screen while keeping relative cursor position on screen. Could you please fix this? Thanks! Erni. -- 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: PageUp/PageDown does not work properly in 10.1.1
Erni Page Up and Page down works for me, what kind of keyboard are you using? Also pressing Option+up/down more than once will page up and down. François On Mar 26, 2012, at 12:45 AM, Erni Wogernom wrote: Hi there, It looks like version 10.1.1 does not have working PageUp/PageDown functionality, which is kind-of unexpected for such advanced text editor. Option+up/down just move cursor to top/bottom line (which is useless btw) instead of jumping up or down one screen while keeping relative cursor position on screen. Could you please fix this? Thanks! Erni. -- 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 -- 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: PageUp/PageDown does not work properly in 10.1.1
Hi François, Keys them-selfs work fine (I am using fn-Up/Down combinations on Mac keyboard). But default editor action is to just scroll page up or down without moving cursor up or down - that would be fine is the was other combination of keys that will scroll text along with moving cursor position. I am guessing Option+Up/Down was intend to be used in that way but it does not work as expected: instead of jumping one page up/down and _keeping_ relative screen position of cursor it move cursor to the very top line or to the very bottom line. But this is a really very bad move: as user I almost _never_ need my cursor on top line of screen or on last line of screen - because for editing I need to see context of editing area and having cursor or top or bottom line effectively hide half of the context. So if I press say Option+Up (two times btw because first will just move to top line, and only second one will scroll text) - I most likely will need to move cursor at least few lines down before I can edit anything. So in the end I will have to press at least 5-6 keys just to jump to previous page and start editing. Please note that 99.9% of other text editors have this operation bind to just one key press, including Apple standard TextEdit and Pages (fn+option+up/down will trigger that action). So from user perspective this functionality is clearly broken in BBEdit. Thanks, Erni. On Mar 26, 8:57 am, François Schiettecatte fschietteca...@gmail.com wrote: Erni Page Up and Page down works for me, what kind of keyboard are you using? Also pressing Option+up/down more than once will page up and down. François On Mar 26, 2012, at 12:45 AM, Erni Wogernom wrote: Hi there, It looks like version 10.1.1 does not have working PageUp/PageDown functionality, which is kind-of unexpected for such advanced text editor. Option+up/down just move cursor to top/bottom line (which is useless btw) instead of jumping up or down one screen while keeping relative cursor position on screen. Could you please fix this? Thanks! Erni. -- 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 -- 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: Customising matching brackets functionality
On Mar 25, 2012, at 20:31, Balthasar Indermuehle wrote: Is it possible to create a custom set of matching word terminators? i.e. make it recognise FOR as the opening bracket to a ENDFOR closing bracket ? I'm still on version 9.6.3, so if 10 can do it, a reason for an upgrade! __ Hey Balt, You can do pretty much what you want, although the logics can get interesting. try tell application BBEdit tell text of front text window find \\bFOR\\b options {search mode:grep, starting at top:false, wrap around:false, backwards:true, case sensitive:true, match words:false} with selecting match find \\bENDFOR\\b options {search mode:grep, starting at top:false, wrap around:false, backwards:false, case sensitive:true, match words:false, extend selection:true} with selecting match end tell end tell on error eMsg number eNum set {c, s} to {return, --} set e to s c Error: eMsg c s c Error Number: eNum c s beep display dialog e end try This is case-sensitive for FOR...ENDFOR. It expects the cursor to be between the terminators. Save the script. Put it in the Script Menu. Give it a keyboard shortcut. And go to town. -- 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
Re: AppleScript Get contents of lines
On Mar 25, 2012, at 20:35, James wrote: I'm working with various selections in a document, and at times the line immediately following the selection needs to be read into a variable for future comparison. Thus, let's say the two below columns represent two different files. __ Hey James, If I undersand correctly you'll have a selection that looks like this: OR try tell application BBEdit tell text of front text window set sel to selection set textOfSel to contents of selection repeat while last character of textOfSel is return set textOfSel to text 1 thru -2 of textOfSel end repeat set selLastLine to endLine of sel set nextLine to selLastLine + 1 set nextLineText to contents of line nextLine {textOfSel, nextLineText} end tell end tell on error eMsg number eNum set {c, s} to {return, --} set e to s c Error: eMsg c s c Error Number: eNum c s beep display dialog e end try Pretty straightforward. -- 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 inline: BBEdit.snapz.001.jpginline: BBEdit.snapz.002.jpg
Re: Removing file from project list when not found on FTP
The way I handle this problem is to rename the file back to whatever it is in the project file. Then I can remove it from the project without that bug, and afterwards rename it back to the new name. On the other hand, if I accidentally add a directory to the project list as opposed to a file, I know of no way to remove it besides editing the bbprojectdata file. You have to be careful to remove both keys associated with the directory if you do that. There's one key next to the directory entry and one at the top of the file. On Feb 3, 6:29 am, Adrian Bengtson adr...@adagio.se wrote: I've added a file to a project window by dragging it from an FTP window. I've since then renamed that file on the FTP server. Now I trying to remove the file from the project list. But everytime I right- click on the file in the list to access the Remove menu item BBEdit throws me a error (kErrCouldNotStartDataTransfer (application error code: 22160)) since BBEdit is trying to open the file over FTP and can't find it. Is there another way to remove a file from a project list without contextual menu? (I know I can edit the project.bbprojectdata file, but I think I'm just missing an obvious way to do this in BBEdit.) /Adrian -- 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
grep help
I'm trying to replace the /td in a long table with /th using grep th scope=row6-Grain Flakes/td .. to.. th scope=row6- Grain Flakes/th i tried th scope=row*/td .. to.. th scope=row*/th to no avail there are over 100 rows ion this table tr th scope=row6-Grain Flakes/td td1 cup/td td align=right3 3/8/td /tr tr th scope=rowAlmond flour, toasted/td td1 cup/td td align=right3 3/8/td /tr tr th scope=rowAlmonds, sliced/td td1/2 cup/td td align=right1 1/2/td /tr -- 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: grep help
FIND: (th scope=row.?*)/td CHANGE TO: \1/th -- On 3/26/12 at 12:23 PM -0700, JT wrote in a message entitled grep help: I'm trying to replace the /td in a long table with /th using grep th scope=row6-Grain Flakes/td .. to.. th scope=row6- Grain Flakes/th i tried th scope=row*/td .. to.. th scope=row*/th to no avail there are over 100 rows ion this table tr th scope=row6-Grain Flakes/td td1 cup/td td align=right3 3/8/td /tr tr th scope=rowAlmond flour, toasted/td td1 cup/td td align=right3 3/8/td /tr tr th scope=rowAlmonds, sliced/td td1/2 cup/td td align=right1 1/2/td /tr -- 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 -- ___ RICK GORDON EMERALD VALLEY GRAPHICS AND CONSULTING ___ WWW: http://www.shelterpub.com -- 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
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: grep help
On Mar 26, 2012, at 15:39, Rick Gordon wrote: FIND: (th scope=row.?*)/td __ Hey Rick, Didn't you switch up your non-greedy modifier? Find: (th scope=row.*?)/td Replace: \1/th -- 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
Re: Insert Next List Item
While I don't have the script available at the moment, the Smart New Line script in the BBEdit Editor Actions Package I linked to a little earlier (http://www.ranea.org/bbedit_editoractions.html) may be something to look at. It handles bullets that are - or * at the start of a line and can continue the list, and handles the current indentation and expand tabs settings correctly. It doesn't try to number lists as the one below does, but that might be something I could add for Markdown. -- Watts Martin Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Monday, March 26, 2012 at 13:45 , KG 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 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
Re: grep help
On Mon, Mar 26, 2012 at 04:06:40PM -0500, Christopher Stone wrote: On Mar 26, 2012, at 15:39, Rick Gordon wrote: FIND: (th scope=row.?*)/td __ Hey Rick, Didn't you switch up your non-greedy modifier? Find: (th scope=row.*?)/td Replace: \1/th This regex will work on the sample text, which has the th and /td on the same line, and no other cells on that line. In general, however, it may match too much; it matches from th scope=row to the next /td, even with a /th in between. (e.g. th scope=row/thtd/td) To avoid that issue, you could use the below regex, which will not match a th scope=row that is already closed with a /th, (and also can match across multiple lines): Find (?s)(th scope=row(?(?!/th).)*)/td Replace \1/th Ronald -- 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: PageUp/PageDown does not work properly in 10.1.1
On 2012-03-25, Erni Wogernom wrote: It looks like version 10.1.1 does not have working PageUp/PageDown functionality, Those work fine over here, and they do just what Page-Down and Page-Up do on other Mac programs - move the page view a whole screen* but NOT the text cursor. *MS Word doesn't move a whole screen by default, but can be set to. which is kind-of unexpected for such advanced text editor. Option+up/down just move cursor to top/bottom line (which is useless btw) instead of jumping up or down one screen while keeping relative cursor position on screen. Could you please fix this? I can't. Did you send your complaint to support? - Bruce _bruce__van_allen__santa_cruz_ca_ -- 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: grep help
I sure did switch up my non-greedy modifier. Thanks for noticing. -- On 3/26/12 at 4:06 PM -0500, Christopher Stone wrote in a message entitled Re: grep help: On Mar 26, 2012, at 15:39, Rick Gordon wrote: FIND: (th scope=row.?*)/td __ Hey Rick, Didn't you switch up your non-greedy modifier? Find: (th scope=row.*?)/td Replace: \1/th -- 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 -- ___ RICK GORDON EMERALD VALLEY GRAPHICS AND CONSULTING ___ WWW: http://www.shelterpub.com -- 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
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 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