Skip to content →

Category: Mac

Batch Renaming Files in DEVONthink Pro with Batch Process

If you’ve been using DEVONthink Pro for a while, chances are you’ve accumulated thousands of documents with a naming convention you’d now like to change. I recently found myself in this exact situation, and DEVONthink’s built-in Batch Process tool saved me hours of manual renaming.

My Use Case: Switching to ISO Date Format

For years, I named all my notes and documents using the format YYYYMMdd-title, like 20250101-notes. It worked fine, but I eventually decided to switch to the ISO 8601 standard format: YYYY-MM-dd-title (e.g., 2025-01-01-notes). The hyphens between date components make it much easier to read at a glance.

The problem? I had thousands of documents in the old format.

Why Not Use Name Mangler?

On macOS, I typically use Name Mangler for batch renaming files in Finder. It’s a fantastic tool for filesystem operations. However, DEVONthink manages its own database, and renaming files through Finder doesn’t work the same way. I needed a solution that worked directly within DEVONthink.

Enter Batch Process.

What is Batch Process?

Batch Process is a powerful built-in tool in DEVONthink Pro that lets you apply a sequence of actions to multiple selected items. You can create reusable configurations for tasks you perform frequently, including renaming files using regular expressions.

Creating a Batch Process Configuration

Here’s how I set up a configuration to convert my date format:

Step 1: Select Files and Open Batch Process

  1. Select one or more files in DEVONthink that you want to rename
  2. From the menu, choose Tools > Batch Process > Batch Process…

Step 2: Create a New Configuration

  1. In the Batch Process dialog, click the + button at the bottom left to create a new configuration
  2. Give it a descriptive name (I called mine “ISO Date”)

Step 3: Configure the Actions

You’ll need two actions to perform the rename:

Action 1 – Scan the filename: – Set the first dropdown to Scan Name – Set the second dropdown to Regular Expression – Enter the regex pattern: ^(\d{4})(\d{2})(\d{2})(.*)$

Action 2 – Change the filename: – Set the dropdown to Change Name – In the “to” field, enter: \1-\2-\3\4

Understanding the Regular Expression

Let me break down how this regex works:

PatternMeaning
^Start of the filename
(\d{4})Capture group 1: exactly 4 digits (year)
(\d{2})Capture group 2: exactly 2 digits (month)
(\d{2})Capture group 3: exactly 2 digits (day)
(.*)Capture group 4: everything else (the title)
$End of the filename

The replacement pattern \1-\2-\3\4 then reconstructs the filename: – \1 = the year (2025) – - = literal hyphen – \2 = the month (01) – - = literal hyphen – \3 = the day (01) – \4 = the rest of the filename (-notes)

So 20250101-notes becomes 2025-01-01-notes.

Running the Batch Process

Once your configuration is saved, using it is simple:

Step 1: Select Files to Rename

Select the files you want to convert. You can select multiple files, an entire folder’s contents, or use DEVONthink’s smart groups to find all files matching your old naming pattern.

Step 2: Apply the Configuration

From the menu, select Tools > Batch Process > ISO Date (or whatever you named your configuration).

DEVONthink will process all selected files instantly.

Tips for Using Batch Process

  • Test first: Always test your configuration on a few files before running it on your entire library
  • Use Smart Groups: Create a smart group that matches files with the old naming pattern to easily find all files that need conversion
  • Backup: While DEVONthink’s undo usually works, having a backup before major batch operations is always a good idea
  • Reuse configurations: Your configurations are saved and appear in the Tools > Batch Process menu for quick access

Conclusion

DEVONthink’s Batch Process tool is incredibly powerful for bulk operations. What would have taken hours of manual renaming was accomplished in seconds. If you’re managing a large document library and need to make systematic changes, Batch Process is worth learning.

The combination of regular expression matching and sequential actions makes it flexible enough to handle complex renaming scenarios while remaining accessible through a graphical interface.

Comments closed

How to Disable the File Extension Change Warning on macOS

Have you ever encountered this pop-up when trying to change a file extension?

Are you sure you want to change the extension from “.txt” to “.md”?

If you make this change, your document may open in a different application.

This warning can be helpful, but if you frequently change file extensions and find it unnecessary, you can easily disable it. There are two ways to do this: via the GUI (Graphical User Interface) or the CLI (Command Line Interface).

Disable via GUI

  1. Open the Finder
  2. In the menu bar, go to Finder > Settings…
  3. Click on the Advanced tab.
  4. Uncheck “Show warning before changing an extension

Disable via CLI (Terminal)

If you prefer using the command line, you can disable the warning using Terminal commands.

Disable the Warning

defaults write com.apple.finder "FXEnableExtensionChangeWarning" -bool "true" && killall Finder

Enable the Warning Again

defaults write com.apple.finder "FXEnableExtensionChangeWarning" -bool "true" && killall Finder

Check the Current Setting

defaults read com.apple.finder "FXEnableExtensionChangeWarning"

Reset to Default

defaults delete com.apple.finder "FXEnableExtensionChangeWarning" && killall Finder

For more defaults commands, check out: https://macos-defaults.com

Now you can change file extensions freely without interruptions! 🚀

Comments closed

Kill process running on port

Frequently I’ll run into the case where my IDE (Intellij, Xcode/Vapor) will fail and leave a web server running on a port. I can’t start it again because it is already running. The only way to proceed is to restart your computer or find and kill the process.

To find the a process running on a port you can use the lsof command. You can filter with “-i”, which lists IP sockets.

$ lsof -i tcp:8080

The command will produce output like:

COMMAND  PID   USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
Run     8299 ddiego   15u  IPv6 0xb2782dc730d0c751      0t0  TCP localhost:http-alt (LISTEN)

The PID is the process identification number. You can pass this to the kill command to kill the process:

$ kill -9 8299
Comments closed

Charles Proxy on iOS Simulator

Charles “is an HTTP proxy / HTTP monitor / Reverse Proxy that enables a developer to view all of the HTTP and SSL / HTTPS traffic between their machine and the Internet. This includes requests, responses and the HTTP headers (which contain the cookies and caching information).”

It is one of my favorite tools for debugging network applications. It supports Mac, Windows, Linux and even iOS.

The instructions on their website for SSL connections from within iPhone applications are not quite complete. Especially the last step which is tricky and I often forget. Here are complete instructions for SSL proxy connections on the iOS Simulator.

1. Add SSL Location. After launching Charles, open the menu:
Proxy > SSL Proxying Settings

The click the “Add Button”

Charles - Add Domain

Type in the location you want to add. You can use wildcards if you like. When you’re done, you should see you location in the list:

Charles - SSL Proxying Settings

2. Install Charles Root Certificate in iOS Simulators. Open the menu:

Help > Install Charles Root Certificate in iOS Simulators

Charles - Install Root Cert iOS

This will install the Charles Root Certificate on the Simulator.

3. Enable the Root Certificate. This is the step, they forget to document. And the last part of it is tricky.

On the Simulator, go to:

Settings > General > About > Certificate Trust Settings

Charles - iOS Trust Settings

Swipe the switch to enable the certificate. It will give a warning which you must choose “Continue”

Charles - iOS Trust Settings Enable

You’ll be placed back on the Certificate Trust Settings page with the switch on:

Charles - iOS Trust Settings Enabled

Now is the critical part. Quit the Simulator. Now run your application again and Charles will be able to decrypt your network communications.

Comments closed

macOS Word Breaks

macOS has a feature that lets you change the word delimiter.  By default it considers the “.” to be part of the word and selects the whole thing.  But you can change it to break on the period.

This feature used to be called “Word Break” in previous macOS release.  In macOS Sierra it can be found by going to “System Preferences” and selecting “Language & Region”.  Here you’ll see an option for “Region”.  If you’re in the United States, it should be set to “United States”.  You can change it to “United States (Computer)”.

Here’s what’s happening: ASCII special characters that are part of words between alphabetic ASCII characters:

  • '.:_ in Standard
  • '_ in English (United States, Computer)

 

Here is an example of “United States”

 

 

Here is an example of “United States (Computer)”

 

 

If you change the word break setting, you have to quit and reopen applications to apply the changes.

Note: I found this tip a few years ago and used it on my Mac. After getting a new Mac, it took me awhile to figure out how to do this again. This post is a reminder to myself for next time I need to remember how to do this.

Comments closed

Mac Lock

icon-512@xOne of my favorite features of Alfred 2 for Mac is typing “Lock” to lock the screen. When I switched back to using Spotlight, I missed this feature. I created a Mac app that would lock the screen when launched. You can now type “Lock” in Spotlight to lock the screen or put it in the Dock and lock the screen with one click.

Source: https://github.com/dougdiego/mac-lock

Download: Lock.dmg

Comments closed

WWDC 2015 – Wish list

Last year I made a WWDC 2014 Wish List. I got at least one thing I wanted. But Apple also gave me a whole bunch of things that I didn’t know I wanted.

Here is an updated list for WWDC 2015.

  • Bug Fixes – I’d be very happy if there were less new features and more bug fixes with the current products.  For example please fix the networking issues.  And I’m still having issues with Gmail in OS X Mail.
  • 3rd Party Complications on Apple Watch – Complications are awesome.  I’d like to be able to expose a complication from my app.
  • Complications on iOS Home Screen – Having complications on the Apple Watch, makes me want them on the iOS home screen.
  • Siri Extensibility – I’d like to see Apple open up Siri to third party apps.  For example if I have RunKeeper on my iPhone, I’d like to be able to tell Siri “Start my run”, “End my run”.  When Apple announced HomeKit in 2014, it allowed custom names for things in your house.  A step forward, but I’d like to see more.
  • AppleTV SDK – I’d love to be able to write apps for the AppleTV.
  • Sandboxing – I’m glad that Apple has sandboxing in the Mac App Store.  But it’s too restrictive.  Apps like Coda should be able to run.  Apple should start by sandboxing Xcode.
  • Filesystem – Mac OS X and iOS are due for a new filesystem. ZFS was rumored for awhile but fell through.
  • Extensions – I love extensions, but there are a few problems.  The difference between a share and action extension is confusing.  It’s hard to tell when new extension are available.   There should be more trigger points for extensions.
  • Default Applications on iOS – On OS X you can set a default application for things like mail and web browser.  I wish you could do the same on iOS.
  • Multiple profiles on iOS – It would be nice if iOS supported multiple users, so a family could share an iPad.
Comments closed

iTerm crashing on launch

I’ve recently been using iTerm on the Mac. I was happily using it, until it started crashing on launch. After searching around on the internet, I finally figure out what is wrong. The issue occurred because I was using an external display. When not connected to the external display the app would crash.

I found details in this bug here: http://sourceforge.net/tracker/index.php?func=detail&aid=2889711&group_id=67789&atid=518973

There are 2 easy ways to solve this problem.

1. In the normal terminal type:

defaults delete net.sourceforge.iTerm "NSWindow Frame iTerm Window 0"

2. Open ~/Library/Preferences/net.sourceforge.iTerm.plist and removed the following entry:
NSWindow Frame iTerm Window 0:

Comments closed

WD My Book 1 TB Hard Drive – Partition Failed

I recently bought at Western Digital My Book 1 TB Hard Drive for my MacBook Pro. I wanted to use it for Time Machine backups, which meant that I needed for format it as Mac OS Extended. It came pre-formatted as FAT.

I used Disk Utility to partition it and got an error a few seconds into it.
wd-error
The error window said: “Partition failed. Partition failed with error: File system formatter failed”.

After pulling my hair out for a while, I finally figured it out…

I’m not exactly sure the reason why, but Mac OX has an issue with a “Master Boot Record” bigger than 512mb. Luckily the solution is easy.

1. Open up Disk Utility.

2. Select your drive on the left hand side.

3. Then click on the “Partition” tab.

4. Choose Volume Scheme: “1 Partition” and select the format: “Mac OS Extended (Journaled)”
wd-options

5. Then click on the “Options” button.

6. Here is the important part. Choose “GUID Partition Table” instead of “Master Boot Record”. Then click “OK”.
wd-partition

7. Now click “Apply” to start the partition process. That’s it!

Comments closed

Error 51: Unable to communicate with VPN subsystem.

Occasionally I see the following error when starting the Cisco VPN client on my mac.

The error message reads:
Error 51: Unable to communicate with VPN subsystem.
Please make sure that you have at least one network interface that is currently active and has an IP address and start this application again.

To fix this problem, simply run the following command from the Terminal:
sudo /System/Library/StartupItems/CiscoVPN/CiscoVPN restart

Running a command with sudo, means you’ll need to be an administrator and it will prompt you for your password.

Comments closed