How to support this blog?
Search the site:
Easily launch scripts from Spotlight
Since I try to stick to Apple solutions and free software* I prefer using Spotlight instead of all the smart launchers that we have for macOS.
What I do is that I call my script names that are easy to call first in Spotlight. A few screenshots speak louder than words so here we are:
The series that start with ">" usually is scripts that I use to open something.
See how just typing ">" suggests ">BB". That ">BB" is what I use to open the files selected in Finder with BBEdit.
The one below is ">Tedit", short for "TextEdit" and opens selected files in TextEdit, etc.
If I type "c" after ">", I get the following list of choices. ">command" is to launch an arbitrary command in Terminal, ">Capture" is to use org capture in Emacs (see here and here for more information) and ">cd" just opens a Terminal tab on the front Finder window, or selected Finder folder.
When I use "<" to initiate the search, I get a different list. That series is for scripts that usually act by themselves. "<text file" creates a text file in the front Finder window and proposes to open it in BBEdit for editing, "<facturation" is an invoicing script for the job selected in Finder, "<job" is a job managing script that creates a job hierarchy in Finder based on a mail, along with an event in calendar, and then "<xls2tmx" is a TMX converter for multicolumn Excel reference data (I'll publish it when it's more polished, but creating XML data with AppleScript is documented here).
I have a few more scripts (a dozen) that I routinely call with Spotlight, which I find totally sufficient for my needs.
As you know, hitting Command+Enter when you have a selection in Spotlight is a way to reveal that selection in the Finder if it is available. So when I want to edit a script, I start by calling it in Spotlight, I hit Command+Enter when it is selected and then I call ">SEditor" (Script Editor) or ">debugger" (Script Debugger) on the selection, to open it with the appropriate application...
* Ok, I do have BBEdit, Microsoft Office and Illustrator... And maybe a few others...
Open a file in your editor of choice
Chris Stone has a nice follow-up on the BBEdit user forum.
You know how it is. You double-click on a file thinking it will open in the application that you're working with at the moment and you forget that the file type was associated with a different application...
Back to Finder, right-click on the file, select "Open with..." and you're good. But mousing around macOS can be tedious at times so here is a simple script that I was pretty much given by an ASUL co-lister and that I barely had to adapt to my workflow to make it more general.
Here is the exact same code for TextEdit:
The same for Script Editor:
The same for Script Debugger:
The same for Word:
You get the drift.
Some applications don't work that way, so here is the code for Emacs.app:
What you do now, is create one script for each application you want to open your files with, save the script with a name that Spotlight will easily call first (something like ">BB" for opening in BBedit) and you're done!
Thank you Chris Stone on ASUL (and all the others) for your help !
Transcription software for free?
Fast forward to 2023...
Most of what I wrote below is correct. But unless you have lots of time on your hands (or work on very difficult recordings), I would strongly suggest that you use Whisper, the OpenAI solution to automatic transcription. It requires basic command line skills, but nothing that you can’t learn in a 10-minute video tutorial. Your machine specs will also make a difference: my 2.8 GHz Quad-Core Intel Core i7 2015 MBP with 16gb of RAM requires about 1.5~2x the length of the soundtrack to produce a very good transcription (of Japanese interviews) that I will later have to edit to produce something useable.
The github page is here: openai/whisper, and includes plenty of links that you might want to read.
About 4 years ago I got a job where I needed to transcribe about 40 hours of interviews. I wrote most of this article then and let it to rest until now. The solution I propose is a workable solution for transcribing audio/video and can also can be used as a practical introduction to Applescript. I just tested everything in High Sierra, with the current versions of all the mentioned applications.
This article also demonstrates how a few macOS technologies can be put together to create a very robust and integrated solution in a number of very easy steps. The idea is:
- Find a process that you need to automate
- Use Applescript to code the automation
- Use Automator to create a system-wide service to access the automation
- Use System Preferences to assign a shortcut to the service, either available system-wide, or only in a given application
Update (the day after...): a comment on reddit says that the title is not accurate because I do not propose speech recognition. For people not familiar with transcription, plain speech recognition is not a solution because it requires two things: good sound quality and that the software be used to the voice. That is not the case with most transcription situations. But, it is possible to dictate the audio that you are listening to, in which case you'll need the same tools as described here, and you just have to add macOS dictation to the workflow if you want to stick to macOS bundled software.
Homemade transcription software...
- TextEdit
- QuickTime Player
- Applescript / Script Editor
- Automator
- System Preferences
Quicktime Player and Applescript
Automator
System Preferences and Services shortcuts
After "Play": "Pause" and "Rewind"
Time codes...
But what about inserting time codes in your document ?
The resulting string that is put into the clipboard would be something like:
TC: 01:01
An strong alternative to QuickTime Player: VLC
There is an alternative to QuickTime Player that has none of the problems we just described. The software is VLC. It is Free Software and is available directly from the development site. You can make donations to contribute to the development too.
There are a lot of areas where the above code can be improved, but the solutions we have work well enough and can be the basis for a lot of other relatively simple developments.
Update (11/9):
I've changed the code a bit after testing on a real job (in VLC).
First, the time code:
- a line break → move to the next line
- a time code → insert the time code
- another line break → move to the next line
so that I can start to type right away.
I have changed the way the Automator service works too. Instead of feeding the clipboard, and pasting the time code myself, I ask the code to return the string (return TCstring) and I checked the [Output replaces selected text] box at the top of the Automator actions list.
That way the returned value is automatically pasted where I have the cursor.
Another modification, minor this one, in the Step Backward function: I changed the delay from 2 to 1, which is in fact way enough when you just need to clarify a sound. A delay of 2 requires that you wait too long before you can resume typing.
Now, you must really be careful about the shortcuts so that the don't interfere with normal navigation in the text.
I chose the following:
Control + ] for "VLC Play+Pause"
Control + [ for "VLC Rewind"
Control + ↓ for "VLC Time Code"
I've just finished transcribing a short 6 minutes interview with this setting and everything worked like a charm.
Popular, if not outdated, posts...
-
6/12/2024 update My version of macOS is too old to be able to use brew reliably since the package manager deprecated support for Monterey (m...
-
Introducing the Okapi Framework plugin for OmegaT This is a summary for people who want a "shortcut". [Updated Feb. 1st 20...
-
Update With the latest hardware updates, RAM price has considerably dropped. The iMac 2gb->4gb update drops from ¥89,000 to ¥47,000, same...
-
So, you’ve tried Hugo , you’ve tried org-publish , but you’re still not satisfied with what you have. Hugo is way too complex and org-publi...
-
This is my first “Zotero” thing. Arguably not very related to translation, but who knows. It’s an attempt at answering the following comment...



