xenodium · 2022-10-09 18:49
xenodium · 2022-10-09 18:54
tl;dr you can get multi-selection reveal in macOS Finder with [dwim-shell-command](https://github.com/xenodium/dwim-shell-command) using the following snippet. The [reveal in macOS Finder (DWIM style) post](https://xenodium.com/emacs-reveal-in-finder-dwim-style/) has more details.
(defun dwim-shell-commands-macos-reveal-in-finder ()
"Reveal selected files in macOS Finder."
(interactive)
(dwim-shell-command-on-marked-files
"Reveal in Finder"
"import AppKit
NSWorkspace.shared.activateFileViewerSelecting([\"<<*>>\"].map{URL(fileURLWithPath:$0)})"
:silent-success t
:shell-pipe "swift -"
:join-separator ", "))
edit: typos
Atemu12 · 2022-10-09 21:18
Could you put these cool macOS integration plumbing functions you show here into package?
xenodium · 2022-10-09 21:27
Most commands are already available as a separate package (under [dwim-shell-commands.el](https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-commands.el)). See [install command line utilities](https://github.com/xenodium/dwim-shell-command#install-command-line-utilities).
brandon_t2009 · 2022-10-09 22:54
That’s awesome!
alkatraz445 · 2022-10-10 01:16
Emacs is my God
[deleted] · 2022-10-10 04:26
Mine too.
divinedominion · 2022-10-10 08:05
Sweet, a great example!
divinedominion · 2022-10-10 15:33
Also impressive how fast `swift - "..."` executed the reveal operation. Didn't expect that to work so well
xenodium · 2022-10-10 15:53
Same here. Seems to work fairly well so far. Got other ideas to send to `swift -`? ;)
divinedominion · 2022-10-10 16:00
I mean, it could do anything :) Download, encrypt, that can be done via other CLI tools. Valuable Apple API could be Natural Language toolkit for some stats.
xenodium · 2022-10-10 16:52
Same idea in ob-swiftui https://xenodium.com/previewing-swiftui-layouts-in-emacs-revisited/
Primary-Wave2 · 2022-10-11 15:29
Can I ask what emacs port you are using for Mac?
Just curious
xenodium · 2022-10-11 15:34
Emacs plus with native como https://xenodium.com/emacs-plus-with-native-comp
xenodium · 2022-10-12 01:32
Ok, getting a little more daring with Swift... Totally experimental, but see if this works for you [M-x dwim-shell-commands-macos-share](https://github.com/xenodium/dwim-shell-command/blob/919817520fa507dd3c7e6859eb982976e28b2575/dwim-shell-commands.el#L370)