From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yHU/BZiNwWAGTQAAgWs5BA (envelope-from ) for ; Thu, 10 Jun 2021 05:57:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id CMppAJiNwWAdCQAA1q6Kng (envelope-from ) for ; Thu, 10 Jun 2021 03:57:12 +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 0550019313 for ; Thu, 10 Jun 2021 05:57:11 +0200 (CEST) Received: from localhost ([::1]:51386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrBob-0006Ay-Vg for larch@yhetil.org; Wed, 09 Jun 2021 23:57:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrBoF-0006Ak-RP for emacs-orgmode@gnu.org; Wed, 09 Jun 2021 23:56:47 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:40930) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lrBoD-0008Ui-S9 for emacs-orgmode@gnu.org; Wed, 09 Jun 2021 23:56:47 -0400 Received: by mail-wr1-x434.google.com with SMTP id y7so461780wrh.7 for ; Wed, 09 Jun 2021 20:56:45 -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=W+YdgrNNfP/9XdSosZRBGrD1uto8n1Ew7SuFMObeplE=; b=GoCoc/2ymRre2VEBZRgAKul/05hnZap1o2RQFkfu5zwC+msFFitMrrkqJnwFg7mH6t QuFuP/esjoMjN7rkHvc9SofXPVhkO7hajfmKCN0fgScz5RkMiqPPW96QoE6AZIMX+CN8 hn97k6IKcdNCZa7poVszbEkFFnKoTurNs2/XKkGim6ip85Swta/OZxGQQ1rCq+WeBtyP LtuIPLZoPuJmoIKVydPUWlV+I8qBueGdrWteajUWF3V5oEok66KMneYxwPyO7jC5HyDE 8gis63LciqbOHbMfXr7wRopna27b8jVrmZpQRhn0uS0jjATtN0fnIvkNQneIDKbuKO03 dHKQ== 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=W+YdgrNNfP/9XdSosZRBGrD1uto8n1Ew7SuFMObeplE=; b=qGOSRjRb3wLFj+lQxPZnE8d6XauvC+JyU05U0p5kAX1M+Mxyo1Mek8bIkmdUN+uP4o 698umpJ+7vfsz2OlYVmVvjXjBm8jjqR3H2iqGG2JEaOthZLdccIaRM7J04AwmHk5gXCK ADqSw+mI3YwSCV5CJYSVHElAbkkNR/in2+ZYIBV9A83ESQ89Cs0Uda6B0mPP64DZsH15 CmcNPcT8APFONOU3xyNW5H07xGShUMo4XvbwACYlDvXGWiNdHjB51xS26YkJ2/+9AZ2/ BVREGRZImADgi1TpE1P6IV/+zsVK4w7/oVhK3Cp8Im6FA8Y10H0ZG5gmUoj0t1fwC3cL 3StA== X-Gm-Message-State: AOAM530RCdKfRWbKdbgu9L1s4ByADR2C3cH/0Gr5u9wxx3zk/VZFHWAG bPKfvXGU4Z4GB0CyJuS9C44YhYyNn2k= X-Google-Smtp-Source: ABdhPJwVyFFBzs+HBknnuKBJR+mJTm9QQuppOuJTtIQfB48kJGeZNKwPJCHne3NSDbihhXjyiZrE7w== X-Received: by 2002:adf:d1e8:: with SMTP id g8mr2861042wrd.309.1623297404288; Wed, 09 Jun 2021 20:56:44 -0700 (PDT) Received: from [192.168.0.97] ([47.61.138.60]) by smtp.gmail.com with ESMTPSA id k25sm9767535wmi.36.2021.06.09.20.56.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Jun 2021 20:56:43 -0700 (PDT) Subject: Re: org-attach a directory? To: John Kitchin References: <5a5703fb-943c-4da8-8981-63cac9ef3bae@gmail.com> From: Ypo Message-ID: Date: Thu, 10 Jun 2021 05:56:41 +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="------------9722FA63F1BC103EC41C2F92" Content-Language: es-ES Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=ypuntot@gmail.com; helo=mail-wr1-x434.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=1623297431; 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=W+YdgrNNfP/9XdSosZRBGrD1uto8n1Ew7SuFMObeplE=; b=QeD536epqnfgTQgyXAYVgVLvCFh9uTNSEY0HQvKcaWV9m4QtNcEiZhsH4US43xnyo5MRXu enRYbmwCqbc0Y14RQ0FdCBLgeF6F6SfHQkBa6NaGWC/tDOKI350FKOXn6pZLc8t8eC9FXG vp4XwE0IIfn3wdsM0JtsrYhGcAJQhWrWdJP/VQwOBAGzptXHyHRYZ45V4WaFHnLQhUWFqQ /dt9qt7KEAstBaZDiiBndVfEiaKyJt1HURu24sY0hG7/qfKALpv0h2pX8Js+gAUPozmYu9 XkahMirwCm42JP4eBdCu5VEJFqQSUl1iYqqD5UOp+UvoLqFbkhYSdy5BSXQY/Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623297431; a=rsa-sha256; cv=none; b=NeJaIcvLj0GkEdW9S5eJ5TcY/Nnu0qq+CTusp4qBx3rdbFK9kZHC6B9a6pv/qvxPBmOByf 6JClvfjuXs2irCIt6ZEU7ua6BQSkU8x18Fzv7GG64/EOL8Jea9FV247gSoCQll2Yhp7mxA s9DmXlqXE0EWbnrjPFMMB/Mnhfqd80JSZIKqkN1K7ZX2UFAA5WZDxBricFlUB1lGFhJcuW mG5hzgSYF9mNPcoMwkPjQqjsBLkAWx1XHdNM/GioUQjzRtg/16gQiJ/Dp3znlfS50X8xjd 3STkoFvTS/HEuLN/wEJe34xhwyzaH8s+d3jXPp/trIyG9at6WID99TcBMRBq8Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b="GoCoc/2y"; 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="GoCoc/2y"; 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: 0550019313 X-Spam-Score: -2.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: T50jJFFQd2yu This is a multi-part message in MIME format. --------------9722FA63F1BC103EC41C2F92 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit C-c C-a s (not "S" like in the video, but "s") 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 > --------------9722FA63F1BC103EC41C2F92 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

C-c C-a

s

(not "S" like in the video, but "s")

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
--------------9722FA63F1BC103EC41C2F92--