[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: org-attach a directory?

From: Ypo
Subject: Re: org-attach a directory?
Date: Thu, 10 Jun 2021 05:54:00 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

Hi John :-)

Take a look:


El 10/06/2021 a las 1:39, John Kitchin escribió:
can you give an example of those commands, I tried the key commands 

C-c C-a which opens the dispatcher
s to set a directory
then C-c C-a z to sync, but it did not do anything but add a :DIR: property. it didn't move or copy files anywhere.

Here is the code I am currently using that basically does what I want. 

(defun scimax-org-attach-attach-directory-cp (dir)
  "Copy DIR as an attachment to the current heading."
  (interactive "DDir: ")
  (copy-directory dir (file-name-as-directory (org-attach-dir 'get-create)))
  (org-entry-put (point) "ATTACHMENTS"
 (org-entry-get (point) "ATTACHMENTS")
 (format " [[attachment:%s]]" (car (last (f-split dir)))))))

(defun scimax-org-attach-attach-directory-mv (dir)
  "Move DIR as an attachment to the current heading."
  (interactive "DDir: ")
  (scimax-org-attach-attach-directory-cp dir)
  (delete-directory dir t t))


Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213

On Wed, Jun 9, 2021 at 3:35 PM Ypo <ypuntot@gmail.com> wrote:
Firstly you set the folder where your files are as attachment DIRectory.

Then, you set your target attachment DIRectory (always using the attachment commands).

After doing this, you will be offered the option to copy and delete all the files from the former to the target folder.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]