From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: org-protocol in windows and Acrobat Reader Date: Sun, 18 Mar 2012 21:09:08 +0100 Message-ID: <87d389pt7f.wl%dmaus@ictsoc.de> References: Mime-Version: 1.0 (generated by SEMI-EPG 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Sun_Mar_18_21:09:08_2012-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9MPm-00036c-GD for emacs-orgmode@gnu.org; Sun, 18 Mar 2012 16:09:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S9MPg-00040Y-KO for emacs-orgmode@gnu.org; Sun, 18 Mar 2012 16:09:18 -0400 Received: from app1a.xlhost.de ([213.202.242.161]:58054) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9MPg-00040J-Dh for emacs-orgmode@gnu.org; Sun, 18 Mar 2012 16:09:12 -0400 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: "d.tchin" Cc: emacs-orgmode@gnu.org --pgp-sign-Multipart_Sun_Mar_18_21:09:08_2012-1 Content-Type: text/plain; charset=US-ASCII At Thu, 15 Mar 2012 20:16:10 +0000 (UTC), d.tchin wrote: > > 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|). This indicates that .replace('|',':') didn't work out as expected and org-protocol received org-protocol://store-link://file%3A%2F%2F%2FC%7C%2FTemp%2Ffile.pdf ^^^ Maybe this could do the trick: ,---- | app.addMenuItem({cName:"org-store-link", cParent:"File", | cExec:"app.launchURL('org-protocol://store-link://'+ unescape | (encodeURIComponent(this.URL.replace('|',':'))));"}); `---- I.e. replace | by : in the original URL before encoding it. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de --pgp-sign-Multipart_Sun_Mar_18_21:09:08_2012-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit Content-Description: OpenPGP Digital Signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EABEIAAYFAk9mQOQACgkQDMLgk1Evc4VjPwD8C0evh1B/klnRf1lTAUXvDhcy ICh+7HZDCJrelK42mhgBAKIQiPicpO1bXFJxlbr/IfydqnxdIsJVOFMCwaYNS1/G =LONG -----END PGP SIGNATURE----- --pgp-sign-Multipart_Sun_Mar_18_21:09:08_2012-1--