My Siri Shortcuts 中文
Shortcuts wrote by me is stored in folder Shortcuts.
Shortcuts wrote by others is stored in folder collection.
Shortcuts modified by me is stored in folder modified.
Binary Plist Files with file extension shortcut
is exported by Shortcuts.app.
Import is also supported. macOS QuickLook supports shortcut
files.
How to import/export shortcuts:
- open shortcuts.app
- From menu bar click "File"
- Click "Import..." or "Export..."
Use with Emacs
;; Siri Shortcuts: OCR
;; {{{
(defun my/siri-ocr ()
(interactive)
(shell-command "shortcuts run \"OCR Selected Area\"")
(do-applescript "tell application id \"org.gnu.Emacs\" to activate")
)
(keymap-global-set "C-c M-o" #'my/siri-ocr)
;; }}}
Use with Emacs
;; Siri Shortcuts: Translate
;; {{{
(add-to-list 'display-buffer-alist
(cons "\\*Async Shell Command\\*.*" (cons #'display-buffer-no-window nil)))
(defun my/siri-translate ()
(interactive)
(let ((tempfile
(make-temp-file "siri-translate-" nil ".txt") ; temp file
))
(write-region (format "%s" (thing-at-point 'paragraph)) nil tempfile)
(shell-command (format "shortcuts run \"Translate File\" -i %s &" tempfile))
)
(do-applescript "tell application id \"org.gnu.Emacs\" to activate")
)
(keymap-global-set "C-c t" #'my/siri-translate)
;; }}}