How to adjust page guide?

55 views
Skip to first unread message

Dave Cloud

unread,
Aug 17, 2018, 5:10:24 PM8/17/18
to BBEdit Talk
Not seeing it settings or web search.

Rich Siegel

unread,
Aug 17, 2018, 5:15:24 PM8/17/18
to bbe...@googlegroups.com
On 8/17/18 at 5:09 PM, skyd...@gmail.com (Dave Cloud) wrote:

>Not seeing it settings or web search.

Here's a screen shot to illustrate. (Top tip: the preferences
are searchable as well.)

Enjoy,

R.
--
Rich Siegel Bare Bones Software, Inc.
<sie...@barebones.com> <http://www.barebones.com/>

Someday I'll look back on all this and laugh... until they
sedate me.
Screen Shot 2018-08-17 at 5.13.18 PM.png

F. Alfredo Rego

unread,
Aug 20, 2018, 10:46:58 AM8/20/18
to BBEdit Talk
Rich shared a wonderful top tip: the preferences are searchable as well.

Has anyone found a way to search previous searches (ideally filtering by “Search” vs. “Grep”)?

Clicking on the history button provides a list that’s not trivial to navigate:



Thanks.

Alfredo



--
This is the BBEdit Talk public discussion group. If you have a feature request or would like to report a problem, please email
"sup...@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+un...@googlegroups.com.
To post to this group, send email to bbe...@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.

Barbara Snyder

unread,
Aug 20, 2018, 11:53:51 AM8/20/18
to BBEdit Talk
Alfredo --

I don't know about searching the past searches, but typing the first couple of letters navigates the list.

-- Barbara

F. Alfredo Rego

unread,
Aug 20, 2018, 12:40:26 PM8/20/18
to BBEdit Talk
Barbara:

Nice! This is very helpful and a step in the right direction. 

I look forward to discovering more steps in the journey to learning about more and more BBEdit features.


Thank you for the tip.

Alfredo



Barbara Snyder

unread,
Aug 20, 2018, 1:04:48 PM8/20/18
to bbe...@googlegroups.com
I also recommend reading through the Expert Preferences in the online help. It gives lots of how-to info on what you can already do in the product, along with options for changing behaviors that you can't access through the UI.

-- Barbara


You received this message because you are subscribed to a topic in the Google Groups "BBEdit Talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bbedit/qGlrx7sff44/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bbedit+un...@googlegroups.com.

F. Alfredo Rego

unread,
Aug 20, 2018, 4:15:42 PM8/20/18
to BBEdit Talk
Rich will probably give me some grief but here is what I did, in case my fellow BBEdit users might find this useful.

Perhaps an enterprising person will improve my grep patterns and will be kind enough to build a script ;-)


1) Open a COPY of this file with BBEdit. 
   Whatever you do, BE SURE not to modify the original file.
   Your most recent searches might not be included, do to system cache management: 

   /Users/alfredo/Library/Preferences/com.barebones.bbedit.plist


2) To get the part that I highlighted for ALL searches you have done,
   do a grep search along these lines and “Find All”:

   <date>.*</date>\n\s*<key>SearchString</key>\n\s*<string>.*</string>

   

   
3) Select all the results:

   


4) Copy these results and create a new BBEdit file with the clipboard. You’ll get something like this:



5) Do a grep search and replace along these lines and “Replace All”:

   Find: ~/Library/.*<date>(.*)</date>\n\s*<key>SearchString</key>\n\s*<string>(.*)</string>
                           ^^^^                                                ^^^^
                           subgroup \1                                         subgroup \2                            

   Replace: \1  \2

   (choose whatever separation you prefer between the dates in “\1” and your search strings in “\2”)

   You’ll get something like this:

   



6) If you want to have your most recent searches at the top, sort lines inversely:

   

   


Enjoy.

Alfredo

Christopher Stone

unread,
Aug 24, 2018, 2:54:24 PM8/24/18
to BBEdit-Talk
On 08/20/2018, at 15:15, F. Alfredo Rego <F.Alfr...@gmail.com> wrote:
Rich will probably give me some grief but here is what I did, in case my fellow BBEdit users might find this useful.


Hey Alfredo,

Here's a live working solution.

It's a bit quick and dirty, so the formatting isn't as precise as I'd like – but I don't have time to do better right now.

I've provided the source and a compiled AppleScript which can be opened and run with the Script Editor.app (or Script Debugger -- SD-Lite is now free).

Install here:

~/Library/Application Support/BBEdit/Scripts/

Give it a keyboard shortcut and go-to-town.

--
Best Regards,
Chris

----------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2018/08/24 13:36
# dMod: 2018/08/24 13:48
# Appl: BBEdit, AppleScript & Perl
# Task: Extract Recent Find Strings from BBEdit Preferences.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Save, @Perl, @Extract, @Recent, @Find, @Strings, @Prefs, @Preferences
----------------------------------------------------------------

set scriptSrc to text 2 thru -1 of "
#!/usr/bin/env perl -0777 -nsw
use v5.010;

$_ = `
    plutil -convert xml1 ~/Library/Preferences/com.barebones.bbedit.plist -o - 
`;

/<key>FindDialog_SearchReplaceHistory.+<key>FindDialog_SelectedSourceNodes<\\/key>/ms;

$_ = $&;

s!^\\h*<key>(FindDialog_SearchReplaceHistory|FindDialog_SelectedSourceNodes)</key>\\R?!!gm;
s!^\\h*</?array>\\R?!!gm;
s!^\\t\\t!!gm;
s!^\\h*<key>(CaseSensitive|EntireWord|GrepEnabled|SearchDate|WrapAround)</key>\\R?!!gm;
s!^\\h*<(true|false)/>\\R?!!gm;
s!<dict>\\R?!!gm;
s!</dict>\\R*\\Z!!gm;
s!<key>SearchString</key>\\R?!<key>Find:</key>!gm;
s!<key>ReplaceString</key>\\R?!<key>Replace:</key>!gm;
s!<string>!“!gm;
s!</string>!”!gm;
s!</?(?:date|key)>!!gm;
s!^\\h+!!gm;
s!^\\h*Replace:!Repl:!gm;
s!^(\\d+.+)Z!$1:!gm;

my @array = split(/\\n+<\\/dict>\\n+/, $_);

$, = \"\\n\";

my $temp;
my @temp;

foreach ( @array ) {
    @temp = split(\"\\n\", $_);
    @temp = sort @temp;
  $temp = join \" \", @temp;
  $_ = $temp;
}

$_ = join \"\\n\", @array;

s!\\h*(Repl:)!\\t\\t\\t$1!gm;

print;
"

set dataStr to do shell script "
perl -f <<< " & quoted form of scriptSrc

----------------------------------------------------------------

tell application "BBEdit"
    activate
    set newDoc to make new document with properties {text:dataStr, bounds:{0, 44, 1920, 1200}}
    tell newDoc
        select insertion point before its text
        translate html to text with entity conversion without create new document
    end tell
end tell

----------------------------------------------------------------

Extract Recent Find Strings from BBEdit Preferences.scptd.zip

F. Alfredo Rego

unread,
Aug 24, 2018, 3:07:56 PM8/24/18
to BBEdit Talk
Hey Chris,

Cool. I’ll dive into it during the weekend.

Thanks!

Alfredo



--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"sup...@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+un...@googlegroups.com.
To post to this group, send email to bbe...@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.
<Extract Recent Find Strings from BBEdit Preferences.scptd.zip>

Christopher Stone

unread,
Aug 27, 2018, 12:28:13 AM8/27/18
to BBEdit-Talk
On 08/24/2018, at 13:54, Christopher Stone <listm...@suddenlink.net> wrote:
On 08/20/2018, at 15:15, F. Alfredo Rego <F.Alfr...@gmail.com> wrote:
Rich will probably give me some grief but here is what I did, in case my fellow BBEdit users might find this useful.

Here's a live working solution.

It's a bit quick and dirty, so the formatting isn't as precise as I'd like – but I don't have time to do better right now.


Hey Alfredo,

This is better and less of a hack.

It produces a table, and it puts a regex in line one that will find each bracketed string (and selects it).

Cmd-Shift-E to enter the regular expression into the Find dialog behind the scenes.

Cmd-G to find the next string.

I've provided the source text and a compiled AppleScript.

--
Best Regards,
Chris

----------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2018/08/26 22:00
# dMod: 2018/08/26 23:13
# Appl: BBEdit, System Events
# Task: Export Find History to a BBEdit Text Document.
#     : Include a regular expression for entry into Find via Cmd-Shift-E.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @BBEdit, @System_Events, @Export, @Find, @History, @Text, @Document
----------------------------------------------------------------

try

    

    set shCMD to "
    export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/bin:$PATH;
    plutil -convert xml1 ~/Library/Preferences/com.barebones.bbedit.plist -o - 
    "
    set thePlist to do shell script shCMD without altering line endings

    

    tell application "System Events"
        set bbeditPlist to make new property list item with properties {text:thePlist}
        tell bbeditPlist to set plistValue to value of property list items of property list items

        

        set collatorList to {}

        

        tell bbeditPlist
            set FindDialog_SearchReplaceHistory_Value to value of property list item "FindDialog_SearchReplaceHistory"

            

            tell FindDialog_SearchReplaceHistory_Value
                repeat with theRecord in FindDialog_SearchReplaceHistory_Value

                    

                    tell theRecord

                        

                        set srchDate to (its SearchDate as «class isot») as string
                        set srchDate to findReplTIDS("T", " ", srchDate) of me

                        

                        set srchStr to its SearchString

                        

                        try
                            set replStr to its ReplaceString
                        on error
                            set replStr to ""
                        end try

                        

                        set end of collatorList to srchDate & tab & "FIND: ❰" & srchStr & "❱" & tab & "REPL: ❰" & replStr & "❱"

                        

                    end tell

                    

                end repeat
            end tell

            

        end tell

        

    end tell

    

    set AppleScript's text item delimiters to linefeed
    set collatorList to collatorList as text

    

    set shCMD to "
    export LANG=\"en_US.UTF-8\"
    column -t -s$'\\t' <<< " & quoted form of collatorList
    set collatorList to do shell script shCMD without altering line endings

    

    bbeditNewDoc(collatorList, true) of me

    

    tell application "BBEdit"
        tell front text window
            set before its text to "(?<=❰)\\S.*?(?=❱)" & linefeed & linefeed
            select characters 1 thru -1 of line 1
        end tell
        # open find window
        # tell find window
        # set selection to "(?<=❰)\\S.*?(?=❱)"
        # # close
        # end tell
    end tell

    

on error e number n
    set e to e & return & return & "Num: " & n
    if n ≠ -128 then
        try
            tell application (path to frontmost application as text) to set ddButton to button returned of ¬
                (display dialog e with title "ERROR!" buttons {"Copy Error Message", "Cancel", "OK"} ¬
                    default button "OK" giving up after 30)
            if ddButton = "Copy Error Message" then set the clipboard to e
        end try
    end if
end try

----------------------------------------------------------------
--» HANDLERS
----------------------------------------------------------------
on bbeditNewDoc(_text, _activate)
    tell application "BBEdit"
        set newDoc to make new document with properties {text:_text, bounds:{0, 44, 1920, 1200}}
        tell newDoc
            select insertion point before its text
        end tell
        if _activate = true or _activate = 1 or _activate = "activate" then activate
    end tell
end bbeditNewDoc
----------------------------------------------------------------
on findReplTIDS(_find, _replace, _string)
    set oldTIDS to AppleScript's text item delimiters
    set AppleScript's text item delimiters to _find
    set _string to text items of _string
    set AppleScript's text item delimiters to _replace
    set _string to _string as text
end findReplTIDS
----------------------------------------------------------------

Export Find History to a BBEdit Text Document.scptd.zip

F. Alfredo Rego

unread,
Aug 27, 2018, 2:57:16 AM8/27/18
to BBEdit Talk
Hey Chris,

Very nice!

Congratulations and many thanks.

Alfredo

--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"sup...@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+un...@googlegroups.com.
To post to this group, send email to bbe...@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.
<Export Find History to a BBEdit Text Document.scptd.zip>
Reply all
Reply to author
Forward
0 new messages