keyboard-maestro

Applescript to Map Esc to Caps Lock when tapped; Control to Caps Lock when pressed (macOS Sierra)?

妖精的绣舞 提交于 2019-12-24 06:45:43
问题 I am well aware of karabiner-elements which is still in development to enable this key mapping in macOS Sierra. However, at the current moment it doesn't work. My thought is that if I map Caps Lock to Control in Preferences/Keyboard/Modifier Keys that gets me half way there. I have seen some interesting things people have done with AppleScript here. I am hoping there is a simple way to achieve this via AppleScript. Its also worth mentioning that karabiner-elements is capable of swapping Caps

How do I get the name of the newest file via the Terminal?

混江龙づ霸主 提交于 2019-12-19 06:20:54
问题 I'm trying to create a macro for Keyboard Maestro for OS X doing the following: Get name of newest file in a directory on my disk based on date created; Paste the text "newest file: " plus the name of the newest file. One of its options is to "Execute a shell script", so I thought that would do it for 1. After Googling around a bit I came up with this: cd /path/to/directory/ ls -t | head -n1 This sorts it right, and returns the first filename. However, it also seems to includes a line break,

Send email from clipboard without opening mail.app

佐手、 提交于 2019-12-10 11:09:27
问题 I searched for how to send email without opening apple mail, and found the question AppleScript - How to send a email without the mail app opening up However, I'm doing this with Keyboard maestro, so that I can send a specific email using a hot key in any application. After googling for the solution I found this script that does the job well: tell application "Mail" set theNewMessage to make new outgoing message with properties {subject:"hello", content:"You got a new file in your Downloads

How do I get the name of the newest file via the Terminal?

陌路散爱 提交于 2019-12-01 04:52:45
I'm trying to create a macro for Keyboard Maestro for OS X doing the following: Get name of newest file in a directory on my disk based on date created; Paste the text "newest file: " plus the name of the newest file. One of its options is to "Execute a shell script", so I thought that would do it for 1. After Googling around a bit I came up with this: cd /path/to/directory/ ls -t | head -n1 This sorts it right, and returns the first filename. However, it also seems to includes a line break, which I do not want. As for 2: I can output the text "newest file: " with a different action in the app