Emacs and Shortcuts

2025-12-07 17:48
[syndicated profile] coyotetracks_feed

It’s a match made in…frankly, I’m not sure where. But I’ve been experimenting with using org-journal as a replacement for Day One, and while it’s pretty good, there are two things that I immediately missed:

The way Day One records my location and the weather for every entry.

Being able to quickly insert photos that I’ve taken into an entry.

Emacs can’t do that directly, but there are Shortcut actions that do everything I need there, right? So there’s got to be a way to get Emacs to talk to Shortcuts.

Well, there is a Shortcuts package for Emacs, but a bit of poking at it revealed that it seems to be just one way communication: it lets Emacs fire off a Shortcut, but doesn’t let the Shortcut return anything back to Emacs. Not so useful. But you know what? There’s a shortcuts command line utility which can not only run a Shortcut, but get results returned to it.

As an example of how to use it, here’s the photo picker Shortcut I created (click on it for a bigger image):

The Photo Picker Shortcut

The first action lets you select photos. Then, it resizes each one and saves them as JPEG files to ~Documents/journal/images/. Lastly—and this is the part that needs to get back to Emacs—it turns each filename into an Org-style link and outputs it.

So, what does Emacs do to call this (and receive it?) It is an extremely simple bit of Lisp code:

(defun wm-journal-photos ()
“Select photos, export, and insert as org links.”
(interactive)
(insert (shell-command-to-string
“shortcuts run "Photos to Org link" | cat”)))

The shell-command-to-string function does what it says: runs a command and gets its output as a string. That string just gets inserted at point. The location and weather Shortcut is even simpler: it just calls the “Get weather at Current Location” action, then creates a text block with LOCATION and WEATHER as Org-mode properties.

(Why, you might ask, does shortcuts run have to be piped through cat to work? You got me. It’s not an Emacs quirk, for the record, it’s an Apple quirk.)

To support my writing, consider a tip on Ko-fi.com.

(originally published at Coyote Tracks)

The Analog Cat

2025-12-05 09:58
[syndicated profile] huskyteer_lj_feed
I have a book out! It's a speculative fiction collection, with some stories leaning more towards sci-fi and some more fantasy. Some are more serious, most are humorous or at least whimsical. All of them have an animal in.

(Read more ...)
tuftears: Lynx Wynx (Default)
[personal profile] tuftears
That's November in the bag!

Cut for length. )

So plan for December... Finish editing the Rose in Nova Paree novel and then start looking for first readers. Try and make the ebook for Timecrossed Engineer so I can give it a last read-through in "finished form." There may be a family Christmas get-together or not, I don't really know.

Maybe I'll start on a new novel... either late December or early in 2026.
[syndicated profile] huskyteer_lj_feed
Howard visited this weekend and we spent Saturday noon at Hitchhiker's Live, an immersive performance of The Hitch Hiker's Guide to the Galaxy at Riverside Studios in Hammersmith.

(Read more ...)

I Saw A Man This Morning

2025-12-01 11:37
[syndicated profile] huskyteer_lj_feed
As soon as I heard the first single from the Divine Comedy's latest album, Rainy Sunday Afternoon, I knew it was a special one. A song about conflict and humanity, blending myth and literature with the more recent past and the modern day, here's:

(Read more ...)

Profile

chipotle: (Default)
chipotle

February 2018

S M T W T F S
    123
45678910
11121314151617
18192021222324
252627 28   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated 2025-12-15 03:52
Powered by Dreamwidth Studios