From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitri Makarov Subject: Re: [PATCH] org-mac-link.el: Handle links to/from Adobe Acrobat. Date: Wed, 9 Sep 2015 17:59:47 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=14dae9cc998e6cf5e0051f5292d7 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZhms-0003Aa-U5 for emacs-orgmode@gnu.org; Wed, 09 Sep 2015 11:59:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZhmo-0001Rh-Fi for emacs-orgmode@gnu.org; Wed, 09 Sep 2015 11:59:54 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:34741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZhmo-0001RS-4Z for emacs-orgmode@gnu.org; Wed, 09 Sep 2015 11:59:50 -0400 Received: by wicfx3 with SMTP id fx3so162598171wic.1 for ; Wed, 09 Sep 2015 08:59:49 -0700 (PDT) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com. [209.85.212.174]) by smtp.gmail.com with ESMTPSA id o9sm10926185wja.29.2015.09.09.08.59.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Sep 2015 08:59:48 -0700 (PDT) Received: by wicgb1 with SMTP id gb1so122298844wic.1 for ; Wed, 09 Sep 2015 08:59:47 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --14dae9cc998e6cf5e0051f5292d7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable This is refactored patch that uses org-mac-paste-applescript-links Regards, Dmitri On Wed, Sep 9, 2015 at 4:11 PM, Alan Schmitt wrote: > Hello, > > On 2015-09-09 12:42, Dmitri Makarov writes= : > >> This is my second attempt to submit a patch that enables grabbing >> links from Adobe Acrobat Pro. > > I do not have Acrobat to test, but I have a small comment. > >> +(defun org-mac-acrobat-get-page () >> + (interactive) >> + (message "Applescript: Getting Acrobat page link...") >> + (let* ((descriptor (as-get-acrobat-page-link)) >> + (components (split-string descriptor "::")) >> + (path (car components)) >> + (title (nth 1 components)) >> + (page (nth 2 components)) >> + (label (nth 3 components)) >> + (link (concat "acrobat:" path "::" page)) >> + (description (concat title ", p." label)) >> + (org-link)) >> + (when (not (string=3D link "")) >> + (setq org-link (org-make-link-string link description))) >> + (kill-new org-link) >> + org-link)) > > Could you reuse `org-mac-paste-applescript-links' for this? For that, > you need to add the "acrobat:" and the ", p." bits in the AppleScript > (as is done for Skim). > > Best, > > Alan > > -- > OpenPGP Key ID : 040D0A3B4ED2E5C7 > Last week athmospheric CO=E2=82=82 average (Updated September 6, 2015, Ma= una Loa Obs.): > 377.86 ppm --14dae9cc998e6cf5e0051f5292d7 Content-Type: text/plain; charset=US-ASCII; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_iecz01ro1 RnJvbSA2ZDRmYmVlZGE5YmJjN2EzMWM2Y2JkNDhhNDUyMzhmOGEzZWZlNTRmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEbWl0cmkgTWFrYXJvdiA8ZG1ha2Fyb3ZAYWx1bW5pLnN0YW5m b3JkLmVkdT4KRGF0ZTogV2VkLCA5IFNlcCAyMDE1IDE3OjI0OjQyICswMjAwClN1YmplY3Q6IFtQ QVRDSF0gb3JnLW1hYy1saW5rLmVsOiBIYW5kbGUgbGlua3MgdG8vZnJvbSBBZG9iZSBBY3JvYmF0 LgoKKiBjb250cmliL2xpc3Avb3JnLW1hYy1saW5rLmVs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