Archive for May, 2019

Default Folder X: Using AppleScript to specify default folders on the fly

Tuesday, May 28th, 2019

Version 5.3.7 of Default Folder X introduced a new capability: it can now ask what the default folder for an application should be on the fly using AppleScript. That may sound like a mouthful of jargon, so let me explain, because it can be applied in a lot of situations.

Jason Snell (of Six Colors and The Incomparable fame) has been writing about Macs forever, and is now a prolific podcaster. He emailed to ask if it would be possible to make Default Folder X more flexible. At that time, you could set a default folder for an application so that when you chose Save As, it always offered to save a file in that particular folder. His problem was that you have to set a single folder as the app’s default folder – just one.

Jason creates podcasts – lots of them. His reasoning was that if he could magically tell Default Folder X what podcast he was working on, it would always offer to save the component audio files into the folder for that podcast. Essentially: Wouldn’t it be great if you could edit an audio clip, hit Save, and have it automatically go into the folder for the current podcast folder? No re-configuring a default folder for each new project – it’d just work.

So he hit on this idea (which I think is just brilliant). He uses Apple’s Logic X application to create his podcasts. So for each podcast episode, there’s one master Logic X project file. To find the correct default folder for audio clips, all he has to do is look at all the project files and see which one has been saved most recently. The “Audio Files” folder sitting next to that project is where everything should go for the current project. He wrote an AppleScript to do this, which he shared on the Six Colors blog.

This can obviously translate to all sorts of different workflows. If you have one primary file for each project, it’s easy to tell which one you’re currently working on – it’s the one that’s been saved most recently.

How to set up an AppleScript to specify a default folder

So how do you wire up Default Folder X to do this? It’s pretty simple. Put an AppleScript script in:

~/Library/Application Support/com.stclairsoft.DefaultFolderX5/Scripts/

or, if you want it to handle only a single application, put it in a sub-folder of the Scripts folder named for the application you want it to serve. To have it queried only for Preview, for example, put an AppleScript in:

~/Library/Application Support/com.stclairsoft.DefaultFolderX5/Scripts/Preview/

Download this example script file to see what you need to do in your AppleScript script:

http://www.stclairsoft.com/download/GetDefaultFolder.zip

The trick is that you need to implement this handler:

on getDefaultFolder(appName, dialogType, firstTime) 

which returns the location of the default folder. Open up the sample script file in Script Editor (or your AppleScript editor of choice) and have a look. I’ve tried to explain things clearly in the comment at the top, and the script shows a number of different ways of returning folders to Default Folder X. And of course, you can also use Jason’s complete script as a starting point.

I think Jason’s idea is great – it streamlines work on multiple projects, but most importantly, it reduces the chance for error as you’re trying to meet that pressing deadline. I’d love to hear how others use this feature, so please drop me a line if it works for you too!

App Tamer 2.4.5 fixes bugs and is notarized by Apple

Tuesday, May 21st, 2019

Version 2.4.5 of App Tamer is a fairly tame release – it corrects a few nagging bugs, and is now checked for malware by Apple and notarized to indicate so. The menu bar icon shows its disabled state more clearly when running in Dark Mode on Mojave, and some processes were mistakenly listed in the “Managed Processes” list even though App Tamer wasn’t managing them (ironically, because of bookkeeping error, they were included in the list because App Tamer never touched them at all).

Full release notes and download links are available on the App Tamer release page.

HistoryHound 2.0.2 scans are more timely

Friday, May 17th, 2019

A change in Safari combined with a bug in HistoryHound meant that previous versions of HistoryHound would often wait much longer than they should have to update the index of your browsing history. Version 2.0.2 fixes this problem, and is also notarized by Apple to ensure its security (and compatibility with macOS 10.15 when the time comes).

You can get release notes and download links at the HistoryHound Release page.

Default Folder X 5.3.7 updates Finder window tracking, shows additional metadata and more

Thursday, May 16th, 2019

Default Folder X 5.3.7 is now available, and it displays a couple of additional pieces of metadata in the Info panel below Open dialogs, most notably the “last opened” date. It also addresses a number of issues, including problems with LaunchBar, sub-par behavior when file dialogs are very large or lie partially off-screen, keyboard shortcuts not working after using a menu bar app, and drag-and-drop problems with the Finder drawer. A full list of changes is available on the Default Folder X Release page or in the Version History.

This version also works around bugs in Mojave that have been affecting Default Folder X’s ability to list open Finder windows when those windows contain multiple tabs. It will now list those windows reliably, but may still get confused and show some tabs as being in their own, separate windows – but hey, at least they’re all there, right? Unfortunately, a complete solution requires that Apple fix the bugs that I’ve submitted.

And one very important note about Finder windows: The behavior of Default Folder X’s Finder-click feature has changed a bit. Most people won’t be affected by this, but if you have been relying on the fact that Finder-click showed windows that weren’t actually visible (because they’re in another Space or because the Finder’s hidden), you’ll find that they’re no longer appearing. They’re still in the Finder Windows menu in Default Folder X’s toolbar, or you can revert to the old behavior by following these instructions.

Finally, on the truly geeky side, you can now create an AppleScript to supply Default Folder X with a default folder for an application on the fly. When a file dialog comes up, DFX will run your AppleScript, and if it returns a folder, that’ll be used as the default folder for that file dialog. It works seamlessly and can really simplify things if you work in a project-based manner with a consistent way of determining where your project folder is. Look for a blog post about this shortly.