Browse Source

Add the ability to highlight the selected text in Skim.app

Make a 'highlight note' upon grabbing a link from Skim.app if the
option 'org-mac-Skim-highlight-selection-p' is t.
Daniil Frumin 12 năm trước cách đây
mục cha
commit
77cef42138
1 tập tin đã thay đổi với 13 bổ sung0 xóa
  1. 13 0
      contrib/lisp/org-mac-link-grabber.el

+ 13 - 0
contrib/lisp/org-mac-link-grabber.el

@@ -136,6 +136,12 @@ applications and inserting them in org documents"
   :group 'org-mac-link-grabber
   :type 'boolean)
 
+(defcustom org-mac-Skim-highlight-selection-p nil
+  "Highlight (using notes) the selection (if present) when grabbing the a link from Skim.app"
+  :tag "Highlight selection in Skim.app"
+  :group 'org-mac-link-grabber
+  :type 'boolean)
+
 
 (defun omlg-grab-link ()
   "Prompt the user for an application to grab a link from, then go grab the link, and insert it at point"
@@ -506,6 +512,13 @@ applications and inserting them in org documents"
        "set theContent to contents of (get text for theSelection)\n"
        "if theContent is missing value then\n"
        "    set theContent to theTitle & \", p. \" & thePage\n"
+       (when org-mac-Skim-highlight-selection-p
+	 (concat
+	  "else\n"
+          "    tell theDoc\n"
+          "        set theNote to make note with properties {type:highlight note, selection:theSelection}\n"
+          "         set text of theNote to (get text for theSelection)\n"
+          "    end tell\n"))
        "end if\n"
        "set theLink to \"skim://\" & thePath & \"::\" & thePage & "
        "\"::split::\" & theContent\n"