Skip to main content
added 374 characters in body
Source Link
RichieHH
  • 880
  • 5
  • 11
(defun insert-property(&optional p)
      "insert PROPERTY value of pdftools link"
      (unless p (setq p "TEST"))
      (message "property passed is: %s" p)
      (let ((pvalue
               (save-window-excursion
                 (message "%s" (org-capture-get :original-buffer))
                 (switch-to-buffer (org-capture-get :original-buffer))
                 (message "retrieved property is: %s" (org-entry-get (point) p))
                 (org-entry-get (point) p)
                 )))
                 pvalue))

I don't think you need any (insert x) call for a start: the function itself should not insert the string - it should just return it.

I had a fiddle and came up with the above function, just to satisfy my own curiosity. I hope it helps. I used org-capture-get and also (point) but maybe that's an alternative way.

Just add %(insert-property "TEST")% in my capture template.

Test data:-

*** scratchpad                                              :tangle no:noexport:
    :PROPERTIES:
    :TEST:     HELLO WORLD
    :END:

My template:-

("t" "Todo" entry
  (file+headline "refile.org" "Tasks To Refile")
  "* TODO %? %(insert-property "TEST")%
:PROPERTIES:
:DateCreated: %T
:END:
")
(defun insert-property(&optional p)
      "insert PROPERTY value of pdftools link"
      (unless p (setq p "TEST"))
      (message "property passed is: %s" p)
      (let ((pvalue
               (save-window-excursion
                 (message "%s" (org-capture-get :original-buffer))
                 (switch-to-buffer (org-capture-get :original-buffer))
                 (message "retrieved property is: %s" (org-entry-get (point) p))
                 (org-entry-get (point) p)
                 )))
                 pvalue))

I don't think you need any (insert x) call for a start: the function itself should not insert the string - it should just return it.

I had a fiddle and came up with the above function, just to satisfy my own curiosity. I hope it helps. I used org-capture-get and also (point) but maybe that's an alternative way.

Just add %(insert-property "TEST")% in my capture template.

(defun insert-property(&optional p)
      "insert PROPERTY value of pdftools link"
      (unless p (setq p "TEST"))
      (message "property passed is: %s" p)
      (let ((pvalue
               (save-window-excursion
                 (message "%s" (org-capture-get :original-buffer))
                 (switch-to-buffer (org-capture-get :original-buffer))
                 (message "retrieved property is: %s" (org-entry-get (point) p))
                 (org-entry-get (point) p)
                 )))
                 pvalue))

I don't think you need any (insert x) call for a start: the function itself should not insert the string - it should just return it.

I had a fiddle and came up with the above function, just to satisfy my own curiosity. I hope it helps. I used org-capture-get and also (point) but maybe that's an alternative way.

Just add %(insert-property "TEST")% in my capture template.

Test data:-

*** scratchpad                                              :tangle no:noexport:
    :PROPERTIES:
    :TEST:     HELLO WORLD
    :END:

My template:-

("t" "Todo" entry
  (file+headline "refile.org" "Tasks To Refile")
  "* TODO %? %(insert-property "TEST")%
:PROPERTIES:
:DateCreated: %T
:END:
")
added 78 characters in body
Source Link
NickD
  • 33.6k
  • 3
  • 30
  • 47
(defun insert-property(&optional p)
      "insert PROPERTY value of pdftools link"
      (unless p (setq p "TEST"))
      (message "property passed is: %s" p)
      (let ((pvalue
               (save-window-excursion
                 (message "%s" (org-capture-get :original-buffer))
                 (switch-to-buffer (org-capture-get :original-buffer))
                 (message "retrieved property is: %s" (org-entry-get (point) p))
                 (org-entry-get (point) p)
                 )))
                 pvalue))

I don't think you neededneed any (insert x) call for a start: the function itself should not insert the string - it should just return it. 

I had a fiddle and came up with thisthe above function, just to satisfy my own curiosity. I hope it helps. I used org-capture-get and also (point) but maybe that's an alternative way.

Just add %(insert-property "TEST")% in my capture template.

(defun insert-property(&optional p)
      "insert PROPERTY value of pdftools link"
      (unless p (setq p "TEST"))
      (message "property passed is: %s" p)
      (let ((pvalue
               (save-window-excursion
                 (message "%s" (org-capture-get :original-buffer))
                 (switch-to-buffer (org-capture-get :original-buffer))
                 (message "retrieved property is: %s" (org-entry-get (point) p))
                 (org-entry-get (point) p)
                 )))
                 pvalue))

I don't think you needed any (insert x) call for a start. I had a fiddle and came up with this just to satisfy my own curiosity. I hope it helps. I used org-capture-get and also (point) but maybe that's an alternative way.

Just add %(insert-property "TEST")% in my capture template.

(defun insert-property(&optional p)
      "insert PROPERTY value of pdftools link"
      (unless p (setq p "TEST"))
      (message "property passed is: %s" p)
      (let ((pvalue
               (save-window-excursion
                 (message "%s" (org-capture-get :original-buffer))
                 (switch-to-buffer (org-capture-get :original-buffer))
                 (message "retrieved property is: %s" (org-entry-get (point) p))
                 (org-entry-get (point) p)
                 )))
                 pvalue))

I don't think you need any (insert x) call for a start: the function itself should not insert the string - it should just return it. 

I had a fiddle and came up with the above function, just to satisfy my own curiosity. I hope it helps. I used org-capture-get and also (point) but maybe that's an alternative way.

Just add %(insert-property "TEST")% in my capture template.

added 8 characters in body
Source Link
NickD
  • 33.6k
  • 3
  • 30
  • 47
(defun insert-property(&optional p)
      "insert PROPERTY value of pdftools link"
      (unless p (setq p "TEST"))
      (message "property passed is: %s" p)
      (let ((pvalue
               (save-window-excursion
                 (message "%s" (org-capture-get :original-buffer))
                 (switch-to-buffer (org-capture-get :original-buffer))
                 (message "retrieved property is: %s" (org-entry-get (point) p))
                 (org-entry-get (point) p)
                 )))
                 pvalue))

I don't think you needed any (insert x) call for a start. I had a fiddle and came up with this just to satisfy my own curiosity. I hope it helps. I used org-capture.getorg-capture-get and also (point)(point) but maybe that's an alternative way.

Just "%(insert-property "TEST")%"add %(insert-property "TEST")% in my capture template.

(defun insert-property(&optional p)
      "insert PROPERTY value of pdftools link"
      (unless p (setq p "TEST"))
      (message "property passed is: %s" p)
      (let ((pvalue
               (save-window-excursion
                 (message "%s" (org-capture-get :original-buffer))
                 (switch-to-buffer (org-capture-get :original-buffer))
                 (message "retrieved property is: %s" (org-entry-get (point) p))
                 (org-entry-get (point) p)
                 )))
                 pvalue))

I don't think you needed any (insert x) call for a start. I had a fiddle and came up with this just to satisfy my own curiosity. I hope it helps. I used org-capture.get and also (point) but maybe that's an alternative way.

Just "%(insert-property "TEST")%" in my capture template.

(defun insert-property(&optional p)
      "insert PROPERTY value of pdftools link"
      (unless p (setq p "TEST"))
      (message "property passed is: %s" p)
      (let ((pvalue
               (save-window-excursion
                 (message "%s" (org-capture-get :original-buffer))
                 (switch-to-buffer (org-capture-get :original-buffer))
                 (message "retrieved property is: %s" (org-entry-get (point) p))
                 (org-entry-get (point) p)
                 )))
                 pvalue))

I don't think you needed any (insert x) call for a start. I had a fiddle and came up with this just to satisfy my own curiosity. I hope it helps. I used org-capture-get and also (point) but maybe that's an alternative way.

Just add %(insert-property "TEST")% in my capture template.

added 2 characters in body
Source Link
NickD
  • 33.6k
  • 3
  • 30
  • 47
Loading
added 61 characters in body
Source Link
RichieHH
  • 880
  • 5
  • 11
Loading
Source Link
RichieHH
  • 880
  • 5
  • 11
Loading