Best hammerspoon scripts4/16/2023 ![]() This would be a straightforward application of Keyboard Maestro. I think you could implement it, though – “if” statements can check the app of the current window. I don’t use Karabiner-Elements because I rarely used my fn mappings and my current model of laptop doesn’t have real function keys to remap.Īs for window groups to switch within, Keyboard Maestro doesn’t have a built-in concept like that. ![]() I haven’t checked if mapping of fn is one of them. Karabiner was forced to be rewritten as Karabiner-Elements (free and open source) because of changes in macOS, and it lost some features in the process. That let me type fn+F to switch directly to the Finder. Then, with Keyboard Maestro, I mapped ⇧⌃⌥⌘F to open the Finder and so on. I used Karabiner (formerly KeyRemap4MacBook) to map my fn key to the combination of Shift-Control-Option-Command. I used to have something set up for this. " uses vim-surround, so can’t be vnoremap Here’s the source: " create Markdown link from selected text using URL in clipboard Just a few days ago I implemented a Vim editor mapping to do a similar thing: turn the selected text into a link with the clipboard used as the URL. It has actions for reading from and writing to the clipboard, and for appending to, prepending to, and searching and replacing in text variables. – Rory custom” that makes smart quotes and apostrophes (“”‘’) easier to type. I have used Ukelele to define my own keyboard layout “U.S. If you would rather Option-A typed ‘∀’ instead of ‘å’, you could set that up by defining a custom math-focused keyboard layout with Ukelele (free). All macOS keyboard layouts let you access an alternate layer of characters by holding Option. To insert a snippet such as the current date using LaunchBar, I open a LaunchBar window with Command-Space, type date to find the “Current Date (ISO format)” snippet, and press Return to insert it.Īlso note that macOS makes typing special characters easier in general. Your defined snippets are then added to your global list of searcheable items, alongside applications you can open and so on. You define text snippets by putting text files in a certain folder. While its most obvious feature is launching applications, one of its many other features is inserting text snippets. However, for my purposes, I realized that I could insert pieces of text more simply by using another program I was already using: LaunchBar (currently $30). TextExpander implements the direct equivalent to AutoHotkey hotstrings, and is probably the best way to implement short hotstrings like a. I had ddate mapped to the current date, and solang marked to a block of markup I used on Stack Overflow. I used to use TextExpander (currently $40/year) for something like this. For examples, compare these three solutions for working around bad default ⌘C behavior in Books: my simple Keyboard Maestro solution, someone’s straightforward Automator solution, and my shorter, situation-specific Automator solution. If you don’t want to buy Keyboard Maestro, macOS’s built-in Automator (free) can be used in some cases. One nice thing about KeyboardMaestro is it can record the keystroke, so you don’t have to remember names like “NumpadAdd”. To replicate the Send, part of your script, you would add a Type a Keystroke block to your macro. In this example, whatever your cursor is over would scroll left in addition to the macro being activated. A Device Key trigger responds to a single device input, but sadly, it doesn’t block the input from being passed to the OS. However, to respond to a mouse input like Scroll Wheel Left, you would have to use a Device Key trigger. ![]() For example, Shift+Ctrl+S triggers a macro that puts my laptop screen to sleep. Most of my macros have Hot Key triggers, which capture to keyboard shortcuts. ![]() Keyboard Maestro’s triggers can associate custom shortcuts with your macros. Each macro can have a number of triggers, most commonly Hot Key triggers. You can also embed shell scripts or AppleScript. In Keyboard Maestro, you define macros using a drag-and-drop scripting language. The closest equivalent to AutoHotkey in general is Keyboard Maestro (currently $36), a proprietary app. Here are the programs I used to do it, and how I could use them to solve your use-cases: AutoHotkey equivalent On macOS, I have managed to set up equivalents to many of AutoHotkey’s features. Yeah, AutoHotkey was great when I was using Windows. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |