Re: [ANN] BBEdit 13.2 (415025) pre-release

2020-09-23 Thread Terje Bless
On Mon, Sep 21, 2020 at 9:02 PM Rich Siegel  wrote:
>
>… "Rescue untitled documents when discarding changes".

This feature couldn't have come just /one/ release earlier? *sigh*

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/CAH687%3D%3DBo0TVMAv8FcmCj8stZYY0f4M-cjBaRQ%2BxxS8_TmRejQ%40mail.gmail.com.


Re: Modify Text Factory from AppleScript?

2016-08-05 Thread Terje Bless
Hi Christopher,

Thanks for the tip. I hadn't really been aware of Smile and
Satimage.osax before and it looks really useful for a lot of use
cases. Will definitely note that for future needs.

For this one, however, if I can't simply automate the tedious bits of
using a Text Factory I will probably break down and write a Text
Filter in Perl for this (maybe with a bit of AppleScript glue). I'm
more comfortable in Perl, so the AppleScript solution was more out of
a desire for a lightweight (lazy) solution.

In any case, thank you for the suggestion; I'm certain it'll come in
handy in future projects!

Regards,
-link


On Fri, Aug 5, 2016 at 12:30 AM, Christopher Stone
<listmeis...@suddenlink.net> wrote:
> On Aug 04, 2016, at 09:53, Terje Bless <l...@pobox.com> wrote:
>
> As I come across new mis-scanned words that seem likely to recur I add a new
> Replace All action to the Text Factory. This is, however, getting tedious to
> do by hand; and so I would like to make an AppleScript that automates as
> much as possible of it.
>
> …
>
> Does BBEdit support script manipulation of a Text Factory?
>
> 
>
> Hey Terje,
>
> You can't manipulate a Text Factory with AppleScript.
>
> What you want to do can be done, but it will need to be done with a script
> and not a Text Factory.
>
> What I would do personally (for speed and flexibility) is use the
> Satimage.osax AppleScript Extension and save the find/replace patterns to a
> file.
>
> That makes saving new patterns and maintaining them simple.  It will also be
> much faster than doing numerous serial find/replace operations with BBEdit's
> native methods and allow for a single undo operation.
>
> I'd probably use two scripts:
>
> A) Open Massage OCR pattern file in BBEdit appending selected text (if any)
> script
> B) Massage OCR text script
>
> That would let me test my pattern before running it with the main script
> (B).
>
> If you want to pursue something like that I'll help you.
>
> --
> Best Regards,
> Chris
>
> --
> This is the BBEdit Talk public discussion group. 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 Google Groups
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to bbedit+unsubscr...@googlegroups.com.
> To post to this group, send email to bbedit@googlegroups.com.
> Visit this group at https://groups.google.com/group/bbedit.

-- 
This is the BBEdit Talk public discussion group. 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 Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Modify Text Factory from AppleScript?

2016-08-04 Thread Terje Bless
Hi,

I'm working on a project to clean up badly-OCR'ed text where some mistakes 
tend to repeat (e.g. "most" is often mis-scanned as "moft") and am using a 
Text Factory with a bunch of "Replace All" actions to automate subsequent 
occurrences of the same error. As I come across new mis-scanned words that 
seem likely to recur I add a new Replace All action to the Text Factory. 
This is, however, getting tedious to do by hand; and so I would like to 
make an AppleScript that automates as much as possible of it.

The dictionary for BBEdit does list Text Factory objects (both the window 
and the document), that are not marked read only, but they seem to only 
contain generic "item" objects. At this point my AppleScript-fu runs out…

The workflow I would like to automate as much as possible is:
1. Select the relevant word in my (OCR) text document
2. Trigger the AppleScript
2.1 Ask for a replacement word
2.2 Create a new "Replace All" action in my existing Text Factory
2.3 Open the "Options" panel of the new action
2.4 Insert the original (mis-scanned) word in the "Search for:" field
2.5 Insert the replacement word in the "Replace with:" field
2.6 Turn on the "Case sensitive" and "Match entire words" checkboxes
2.7 Dismiss the "Options" sheet (hit the "Ok" button)
2.8 Save the Text Factory
2.9 Run the Text Factory

2.2-8 is the bit I need some assistance with (everything else I trust 
Google to supply ;D).

Does BBEdit support script manipulation of a Text Factory? At what level of 
granularity? What would be the syntax for this?

Help?

TIA,
-link

-- 
This is the BBEdit Talk public discussion group. 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: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: update markup command line

2012-08-16 Thread Terje Bless
Hmm. It seems the regular denizens of the list are hibernating or
something. My AppleScript is a bit rusty, but...


On Mon, Aug 13, 2012 at 7:26 PM, jamie chocolate.el...@gmail.com wrote:
 is there a way to run Update  Markup to a folder or documents
 via command line or applescript?

Sure, you can do it with AppleScript (BBEdit is incredibly
scriptable!), and thus you can use any of the options for running an
AppleScript from the command line (osascript, or the Scripting Bridges
from Python or Ruby, or...). Something like this should work:

tell application BBEdit
(*
Here we get whatever we want to run the update on and stash it in a
variable. BBEdit's update command can work on a single file, a
folder, or a site defined in the preferences.
*)
set theDocument to active document of text window 1
set theFile to theDocument's file

-- The options (the with/without stuff) should be familiar from the
GUI, and details can be found in the user manual.
update theFile with skip shielded without nested and show results
end tell


 In Placeholders, is there a way to return the open document's current
 directory?

There's no predefined placeholder in BBEdit that returns the
document's basedir, but you can do it with an included AppleScript,
something along the lines of this:


-- AS handler function called by BBEDit for #bbinclude
on include(theFile, theVariables)
-- BBEdit gives us a file URL, which the Finder doesn't understand,
so coerce it into an alias.
set theAlias to theFile as alias

-- Ask the Finder to figure out the containing folder of our alias 
object...
tell application Finder
-- …and coerce the return type into an alias which is more
convenient to work with later.
set theFolder to theAlias's container as alias
end tell

-- Now we can either grab a Mac-style path...
set theMacPath to theFolder as string
-- …or a Unix-style path...
set theUnixPath to theFolder's POSIX path

-- …and return whichever version we want to BBEdit.
--  return theMacPath
return theUnixPath
end include

Cheers,
-link

-- 
-- 
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: SVN options no longer show up in BBEdit version 10

2012-08-07 Thread Terje Bless
On Wed, Aug 8, 2012 at 12:34 AM, Nick grizfa...@gmail.com wrote:
 Smart SVN 7.0.5 installed

SmartSVN doesn't, I don't think, install the command line version of
Subversion (or, at least, it uses a private copy of svn that's not
accessible to the rest of the system).


 Using SmartSVN, I can connect to my repository and I've updated my local
 files from the repo. My main problem is that I can't find any reference to
 SVN/Subversion or any other source control option in BBEdit. […] When I fire
 up the terminal and type in any type of svn command, I get a command not
 found error. Could that be preventing BBEdit from enabling SVN/Subversion?

Yes, you need to have the Subversion client (the svn command)
installed somewhere that BBEdit can find it (in essence, in the
$PATH). If you're a member of Apple's Developer program ($99 per year
or thereabouts), the easiest way to get it is to download XCode 4.4
and install the Command Line Tools from its “Downloads” preferences
(which, among others, installs SVN and Git). Alternately you can look
at one of the options listed at
http://subversion.apache.org/packages.html#osx.

You might, incidentally, also want to have a look at
http://http://versionsapp.com/ which has received a lot of praise
from Mac developers since it was released.

Cheers,
-link

-- 
-- 
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

2012-08-06 Thread Terje Bless
On Sun, Aug 5, 2012 at 6:20 AM, Steven katesglad...@gmail.com wrote:
 I am trying to remove a date string from an SQL file.

 I have ,'\d\d\d\d\-\d\d\-\d\d \d\d:\d\d:\d\d', as the string I wish to
 replace with  ,

 It does not like that.

What does does not like that mean? That it finds no matches? Or do
you see something that indicates an error?

 I assume I have to \- because - is a character grep uses

You should generally not need to escape the hyphen outside of
character classes (enclosed between [ and ]).

And to get help with this problem you really do need to provide an
example of the data you're trying to match against.

-link

-- 
-- 
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