QA Graphic

BBEdit Canonize Command

Create your own URL Link Library

The Canonize command in BBEdit allows you to do a search and replace based on a user-configured file. Basically, each line is a search/replace statement. This is useful when you want to run the same search/replace job as a weekly task.

Hyperlink Database

If you do a lot of blogging, you may have some external links to certain sites. Usually, you make reference to them at least once in the post.

Using the BBEdit Canonize command, you can have BBEdit automatically put in the hyperlinks. Saving you time in putting in hyperlinks yourself.

You can build different Canonize files for different projects.

Sample URL file:

bbedit <a href="https://www.barebones.com/">BBEdit</a> Apple Computer <a href="https://www.apple.com/">Apple Computer</a> Google <a href="https://www.google.com/">Google</a> FireFox <a href="https://www.mozilla.org/en-US/firefox/new/">FireFox</a> Apple ios Store <a href="https://www.apple.com/app-store/">App Store</a>

Save the file in a commonplace - the BBEdit iCloud folder is a very good option.

Using the Canonize Command

The Canonize Command is located in the Text Menu. (There's no keyboard shortcut.)

Select the transformation file that you wish to use.

Limitations

One of the downfalls of the command is that it does a global search and replace. I am still looking for a way to only replace the first match, not all matches.

I see that there's a way to do it in SED, Perl, and PHP. I just haven't figured it using an external data file.

 

Comments

Add Comments

Name:
Comment:

 

About

As someone who has worked on Macs since 1989, I will use my experience to share tips and tricks with you on Fridays. As a Mac user since 1989, I have seen the evolution of Mac software and hardware, and I know how Mac computers work. I also know how to troubleshoot and fix Mac problems that can arise.

Schedule

SundayOpen Topic
Monday Media Monday
TuesdayQA
WednesdaySnagIt for QA
ThursdayPython
FridayMacintosh
SaturdayInternet Tools