From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CNAgDPmMwWDTSgAAgWs5BA (envelope-from ) for ; Thu, 10 Jun 2021 05:54:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id KJAsB/mMwWCUfwAAB5/wlQ (envelope-from ) for ; Thu, 10 Jun 2021 03:54:33 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 545C8192C7 for ; Thu, 10 Jun 2021 05:54:32 +0200 (CEST) Received: from localhost ([::1]:48998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrBm2-0004Rw-H0 for larch@yhetil.org; Wed, 09 Jun 2021 23:54:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrBlf-0004Ra-QM for emacs-orgmode@gnu.org; Wed, 09 Jun 2021 23:54:07 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:50824) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lrBld-00065T-MX for emacs-orgmode@gnu.org; Wed, 09 Jun 2021 23:54:07 -0400 Received: by mail-wm1-x336.google.com with SMTP id d184so5295435wmd.0 for ; Wed, 09 Jun 2021 20:54:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=yX4bEk1owwsnOifMGIxJDM5N3PZdeTwTAxvTHnj0szY=; b=Tav2yYZIwqoYImpnn3kAIdQBSkYuWu1UhwNN2oJ6fcCc4zTizPaikwCMbeffhV/If1 QaKNJ8Zs9uSMyajYM9zAYP8ipamfuvKDbeug8P8x+n7PAQLEU8GbXJcdpOg2aDJWmerE ArhwmMG0XJEYF1iljUJbrHnJRTkwN7TvXPBAjGL4+uQZL4U43YtyqO/RliqAIkObR1Ur esSHfftsjJSmj+dQwLjnOwrzXDp26NacV5l9Prf4JYmFlZwRGxucQhuGWvvqr97P98Ea bzSeig3CLBJf1gjgDunHKfuhDNQ3n6IA+Fe/dBklAPNc0joaM8RpZbxSZbJlKxxp3YTF mAGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=yX4bEk1owwsnOifMGIxJDM5N3PZdeTwTAxvTHnj0szY=; b=PawVoBHHHSEXKD4+aufezf08YuQPRwDCVQRBXLSxKfNWDgXZTLqW0XG44jASM7GSsn Lsrq/OelZiCOt/DT2wDj+r/YeXKjbzrdA7ZUP6cbJGJvN65GZiFCwuvFCWTmSd66hUmz 4gQfksmtQgLCl31Oj0bJfH9uWylmD8sLImIiI+1ToRFRcEnHYtJmcaQfKXEcLgFxIEvM hRXrRyUiItsa7ZjUsDu9d//e85Qniq0U6F6VWL+sN/1PJ4LOh3uRkJ1EBV4wvtDhk+jx qPe1sGYnUHc8Fk4WLwVs1XKPrU3gatnoWo9dq3HrFPAbcgwnox0Wlcq7TcsA6RRRV9oS QsOQ== X-Gm-Message-State: AOAM531YsuG1iCAy1au7B7yu9OLHAzQ+bS5pypnUjPOwUnwR6W2TV6z6 xOkqBOWk0lW+OJrjzgE7pXU3QY/pV6o= X-Google-Smtp-Source: ABdhPJxBJTQ+kHN7HO3afq0iTxSTn1YtQFURtWMjpO3gia6pf7k516JkzUriRdOO2FConjPn3cmMYg== X-Received: by 2002:a7b:c24a:: with SMTP id b10mr12720702wmj.25.1623297243494; Wed, 09 Jun 2021 20:54:03 -0700 (PDT) Received: from [192.168.0.97] ([47.61.138.60]) by smtp.gmail.com with ESMTPSA id j18sm1804250wrw.30.2021.06.09.20.54.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Jun 2021 20:54:03 -0700 (PDT) Subject: Re: org-attach a directory? To: John Kitchin References: <5a5703fb-943c-4da8-8981-63cac9ef3bae@gmail.com> From: Ypo Message-ID: <7be7c1d0-8814-29de-534e-8eeb15fb24ac@gmail.com> 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 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------417FD46C117E6EA22FFC6AD2" Content-Language: es-ES Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=ypuntot@gmail.com; helo=mail-wm1-x336.google.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_SBL_A=0.1 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Org-mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1623297272; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=yX4bEk1owwsnOifMGIxJDM5N3PZdeTwTAxvTHnj0szY=; b=gFFA+fWle4YVPR4O371oFt556f8Rw2c5NKZbAcpnxwXwO+6kCeRQcZMLw01+LLpJwEq186 23U7L6CSihDlAtxfXllhKgkyCWzaqxgNAm4ah6N8YiKQGHmDk4OKC/nEbcJnOTkUwH64K4 g1M8AK3EAERqNfBa7TXR8T726DospFU+eEscaJ296U0rmydKzBmZbWzysm8vujzu14W/DL hFqJuIi4jj5zBpTQotpaDuzQ8/PJWIRHCtDQgmAC3nO8WS9CRlCfbt1fQuo7rEoVUH/7XR 1048i1m4QMtfD12LuuoWJCCnvhy7572Xwcs44MgzVMgHdRv454KFxuQrtgcUKA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623297272; a=rsa-sha256; cv=none; b=OhQrsy+0i4B17hqF6ZkCaUFpoPPWAyvGFOrPSwKeE3CKBnj+r7UazoCcsq4C2g/10AkNCO lAyIk4He/TSznqb1fQGCKR4MKsVPeQPV9OJQN+6rs7VMIlFcHHxQDCTuhAexBblHsUZZsw MDxmt5rNpr+fOwb6icCdf5lMYMPcJ2cbqEfs8gwfjcQt5lGVctjRNI98bsKjj/G6KA4K3r e0TQZQmd5I+6M8gQqh55neDKCUnFeLtm0fEyNmtFAKSXUStQc696F5U41FfS32GWEbJb8o MK92KkGfSPeR9zdDrBpc5obv0/CI+uPVowpMlw6Tig6uaeKXPMU8a21jWCW74A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=Tav2yYZI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.13 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=Tav2yYZI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 545C8192C7 X-Spam-Score: -2.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: E3Dt6MSA6CTC This is a multi-part message in MIME format. --------------417FD46C117E6EA22FFC6AD2 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi John :-) Take a look: https://mega.nz/file/hKgECBqY#8UVEURWQBvDpno9DPEk8gb8E-zxAJq3F3E8Y9I9xRFk 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-attach-sync) >   (org-entry-put (point) "ATTACHMENTS" > (concat >  (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)) > > > John > > ----------------------------------- > Professor John Kitchin (he/him/his) > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > @johnkitchin > http://kitchingroup.cheme.cmu.edu > > > > On Wed, Jun 9, 2021 at 3:35 PM Ypo > 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. > > Hugs > --------------417FD46C117E6EA22FFC6AD2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Hi John :-)

Take a look:

https://mega.nz/file/hKgECBqY#8UVEURWQBvDpno9DPEk8gb8E-zxAJq3F3E8Y9I9xRFk


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-attach-sync)
  (org-entry-put (point) "ATTACHMENTS"
(concat
 (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))


John

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


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.

Hugs
--------------417FD46C117E6EA22FFC6AD2--