From: David Maus <dmaus@ictsoc.de>
To: "d.tchin" <d.tchin@voila.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-protocol in windows and Acrobat Reader
Date: Sun, 18 Mar 2012 21:09:08 +0100 [thread overview]
Message-ID: <87d389pt7f.wl%dmaus@ictsoc.de> (raw)
In-Reply-To: <loom.20120315T202316-69@post.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2239 bytes --]
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
[-- Attachment #2: OpenPGP Digital Signature --]
[-- Type: application/pgp-signature, Size: 230 bytes --]
next prev parent reply other threads:[~2012-03-18 20:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-15 20:16 org-protocol in windows and Acrobat Reader d.tchin
2012-03-18 20:09 ` David Maus [this message]
2012-03-19 8:03 ` d.tchin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d389pt7f.wl%dmaus@ictsoc.de \
--to=dmaus@ictsoc.de \
--cc=d.tchin@voila.fr \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).