supposing I have following ORG header
* [[http://...][Description]]
How do I extract the link and insert it as a property? My desired outcome should look like:
* Description
:PROPERTIES:
:URL: http://...
:END:
Till now I only found how to remove the link from the header:
(defun afs/org-replace-link-by-link-description ()
"Replace an org link by its description or if empty its address"
(interactive)
(if (org-in-regexp org-link-bracket-re 1)
(save-excursion
(let ((remove (list (match-beginning 0) (match-end 0)))
(description
(if (match-end 2)
(org-match-string-no-properties 2)
(org-match-string-no-properties 1))))
(apply 'delete-region remove)
(insert description)))))