From mboxrd@z Thu Jan 1 00:00:00 1970 From: d.tchin Subject: org-protocol in windows and Acrobat Reader Date: Thu, 15 Mar 2012 20:16:10 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8H6C-0004w0-Uh for emacs-orgmode@gnu.org; Thu, 15 Mar 2012 16:16:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8H69-0008DO-BL for emacs-orgmode@gnu.org; Thu, 15 Mar 2012 16:16:36 -0400 Received: from plane.gmane.org ([80.91.229.3]:37585) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8H69-0008D5-4o for emacs-orgmode@gnu.org; Thu, 15 Mar 2012 16:16:33 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1S8H63-0003cO-Mz for emacs-orgmode@gnu.org; Thu, 15 Mar 2012 21:16:27 +0100 Received: from APuteaux-651-1-76-57.w81-249.abo.wanadoo.fr ([81.249.55.57]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Mar 2012 21:16:27 +0100 Received: from d.tchin by APuteaux-651-1-76-57.w81-249.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Mar 2012 21:16:27 +0100 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 Hi, I try to use a function proposed with org-protocol as explained in this link. http://orgmode.org/worg/org-contrib/org-protocol.html#sec-2 I would like to launch a pdf file in Acrobat Reader and to use org-store- link.js to capture the full path of the document in an org file.I try to use what it was explained on the link I have already and I have a look on the following link. http://article.gmane.org/gmane.emacs.orgmode/6810 It doesn't work as I expect. As I just want to capture the full path of the file (example here is file.pdf in C:\Temp), I use the following javascript call org-store-link accessible in menu File of Acrobat Reader : app.addMenuItem({cName:"org-store-link", cParent:"File", cExec:"app.launchURL('org-protocol://store-link://'+ encodeURIComponent(this.URL));"}); I get the following string given to org-protocol: org-protocol://store-link://file%3A%2F%2F%2FC%7C%2FTemp%2Ffile.pdf There is several issue. The escaped character is not interpreted when feed in emacs and when I use C-c C-l (org-insert-link) I have the following proposition : file: (C|). Then I try the following script, to get '/' character to feed org-protocol: app.addMenuItem({cName:"org-store-link", cParent:"File", cExec:"app.launchURL('org-protocol://store-link://'+ unescape (encodeURIComponent(this.URL)).replace('|',':'));"}); I get the following the expected string : org-protocol://store-link://file:///C:/Temp/File.pdf Again when I use C-c C-l, I have the proposition : file: (C|). I made the assumption that it is a problem of interpretation of '/'.Then I replace this character with "++". app.addMenuItem({cName:"org-store-link", cParent:"File", cExec:"app.launchURL('org-protocol://store-link://'+ unescape (encodeURIComponent(this.URL)).replace('|',':').replace('\/','++','gi'));"}); Then I obtain the following string : org-protocol://store-link://file:++++++C:++Temp++File.pdf This time when I use C-c C-l, I have the proposition : file:++++++C:++Temp++File.pdf So I can get the full path when I replace afterwards each '++' to '/'. Quite tricky to get the final full link !! Do you have a more direct and simplest way to get the direct right link ?