![]() Because my blog posts and assets utilise the publish date, this can lead to a bit of remedial work to line things up again prior to publishing.Īfter doing this manually a few times, I created an automation to allow me to quickly shift posts and assets to a new publish date. This frequently results in me starting writing up a post to be published on one day, but it getting delayed. I feel writing blog posts is useful as it allows me to share thoughts and solutions that others can then build on and utilise for their own needs, but I don’t have a way to set a structured regular time to do this, so it is an ad hoc activity. Things also come up and disrupt the flow, providing further challenges. ![]() I have always got several parallel activities on the go and writing everything down takes time and slow down progress. Writing blog posts is something that I generally struggle to make time to do. But as I noted right at the start, this is very much a plugin of convenience - it is certainly possible to utilise shortcuts in Keyboard Maestro without using it. It is certainly easier to read and maintain than some AppleScript or shell script, and adding in the entry and name of a shortcut is definitely very quick to do. The result is a spoken translation of the selected text.įor example, each of the following successfully translated to “ Bonjour, je m’appelle Stephen”.įor me, this Keyboard Maestro plugin is a much quicker and neater way to write a macro to call a Shortcuts shortcut. That macro puts the text into an instance variable, which is used as text input to the translation shortcut which it calls. When triggered it calls the subroutine, which copies the text to a named clipboard, dumps that into an instance variable (in the subroutine), clears the named clipboard, and then returns the text to the original calling macro. Download Keyboard Maestro Macro: Translate Selection to French.įor this example, I’ve given the macro a trigger of CTRL + OPT + CMD + 8.We can then use this in another macro to pass the selection via an instance variable into the shortcut action, which is set with Input Type “Text”. Download Keyboard Maestro Subroutine: Get Current Selection.Getting the selected text is something I use quite a lot in my Keyboard Maestro macros, so with v10, I set up a macro as a subroutine to make getting the current text selection even easier. ![]() We know that the shortcut is expecting some text to translate, but where would we get the text from? Well, let’s use Keyboard Maestro to pass the current text selection to the shortcut. Now we have this shortcut, let’s see how we can use the plugin to set up a call to it. We will start with a Shortcuts shortcut that takes some text input and then speaks it back to us, translated into French. Results can be set to output to any of the standard Keyboard Maestro options. The path of the file to pass to the shortcut if the Input Type has been set to File. The text to pass to the shortcut if the Input Type has been set to Text. When set to File, it will pass the file for the path specified in the Input File Path field. When set to Text, it will pass the text in the action’s Text Input field to the shortcut. It defaults to None, meaning that no input will be passed to the shortcut. This drop down list has three options - None, Text, and File. The name field is mandatory and is the name of the Shortcuts shortcut to be executed. When you add this action to a macro, you will see the following ![]() Once installed, you should see a new action listed in the Third Party Plug Ins category - Run Apple Shortcut. Drag and drop the plugin ZIP file onto the Keyboard Maestro dock icon.Ensure that the Keyboard Maestro editor is open and the dock icon is visible.If it automatically decompresses on download, just ZIP the folder up again. However, I thought it would be fun to create a convenience plugin to make it even easier to integrate Keyboard Maestro with Shortcuts. Shortcuts can be triggered on macOS using AppleScript or shell script, both of which are relatively easy to do with the Swiss Army knife of Mac automation, Keyboard Maestro. With the public release of macOS Monterey, I have been trying out a few ways of interacting with Shortcuts from a number of automation tools. As of version 10.1 (released May 2022), Keyboard Maestro now has native support for Apple Shortcuts and I would recommend using the native macro actions over this plugin. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |