this post was submitted on 30 Oct 2023
1 points (66.7% liked)

Emacs

315 readers
2 users here now

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 1 year ago
MODERATORS
 

I'm looking for a way to copy images to MacOS Photos App. I know this is probably a rather complex operation, but I also know that there are some die-hard Emacs users out there who use Mac every day. 🍎 So I'm curious if this is possible? Is there a package? I can't seem to find one.

I'm just looking for a way to send images via dired directly to MacOS library at the very least. Since I use dirvish to go through photo sets/collections (Color-tagging them with dired-delight), and I find it to be so much faster to do with dired than with a GUI, I'm just hoping that it's possible for emacs to take me "the next step" to moving the marked ones to the photos libraries I have for MacOS. So, any feedback is welcome! thx! 🙃

top 2 comments
sorted by: hot top controversial new old
[–] xenodium@alien.top 1 points 1 year ago

As a macOS user, I typically glue these dired things via dwim-shell-command (disclosure, I wrote that).

Not super tested, but I added dwim-shell-commands-macos-add-to-photos to dwim-shell-commands.el (the optional part of the package).

(defun dwim-shell-commands-macos-add-to-photos ()
  "Add to Photos.app."
  (interactive)
  (dwim-shell-command-on-marked-files
   "Add to Photos.app"
   "osascript <>\"
  end tell
EOF"
   :silent-success t
   :utils "osascript"
   :on-completion (lambda (buffer process)
                    (if-let ((success (= (process-exit-status process) 0)))
                        (start-process "Open Photos" nil "open" "-a" "Photos")
                      (switch-to-buffer buffer)))))
  1. Select 1 or multiple photos from dired
  2. M-x dwim-shell-commands-macos-add-to-photos

ps. This also works on current buffer if you're viewing an image in a buffer.

[–] xenodium@alien.top 1 points 1 year ago

Probably MELPA hadn’t picked up my changes when you tried it. Maybe update the lckage and try again.