diff options
| author | jao <jao@gnu.org> | 2025-11-05 18:24:11 +0000 |
|---|---|---|
| committer | jao <jao@gnu.org> | 2025-11-05 18:24:11 +0000 |
| commit | 28ec4db6276f4390e02588a0b4d93f5cd3ec8af2 (patch) | |
| tree | fce4996ac7d1df3f9b10e2a4a4547b3084d90b9b | |
| parent | b393aafc3201d9ada1ddab941ee8001fa6108d15 (diff) | |
| download | elibs-28ec4db6276f4390e02588a0b4d93f5cd3ec8af2.tar.gz elibs-28ec4db6276f4390e02588a0b4d93f5cd3ec8af2.tar.bz2 | |
mac: get text from current skim pagemain
| -rw-r--r-- | lib/doc/jao-mac.el | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/doc/jao-mac.el b/lib/doc/jao-mac.el index 1f325c7..ad11ea2 100644 --- a/lib/doc/jao-mac.el +++ b/lib/doc/jao-mac.el @@ -107,6 +107,27 @@ (when-let* ((ps (jao-skim-current-doc))) (apply 'jao-open-doc ps))) +(defvar jao-skim--current-page-text + (jao-mac-applescript-prepare + "tell application \"Skim\"" + "return the text of the current page of the front document" + "end tell")) + +(defun jao-skim-page-text () + (jao-mac-run-applescript jao-skim--current-page-text)) + +(defun jao-skim-view-page-text () + (interactive) + (when-let* ((ps (jao-skim-current-doc)) + (p (car ps)) + (n (cadr ps)) + (txt (jao-skim-page-text)) + (bn (format "*%s - %s - txt*" p n))) + (with-current-buffer (get-buffer-create bn) + (delete-region (point-min) (point-max)) + (insert txt) + (pop-to-buffer (current-buffer))))) + ;;; NetNewsWire (defvar jao-nnw--current-article-script |
