From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luke Amdor Subject: Re: org-mac-protocol/org-protocol-capture Date: Thu, 2 Dec 2010 20:45:24 -0600 Message-ID: References: <1291085620.18733.1407799903@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0567391850==" Return-path: Received: from [140.186.70.92] (port=47913 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1POLee-0005R9-5K for emacs-orgmode@gnu.org; Thu, 02 Dec 2010 21:45:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1POLec-0003aq-Of for emacs-orgmode@gnu.org; Thu, 02 Dec 2010 21:45:48 -0500 Received: from mail-bw0-f41.google.com ([209.85.214.41]:50015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1POLec-0003ai-Cv for emacs-orgmode@gnu.org; Thu, 02 Dec 2010 21:45:46 -0500 Received: by bwz16 with SMTP id 16so15342905bwz.0 for ; Thu, 02 Dec 2010 18:45:44 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Konrad Hinsen Cc: Timothy Brown , emacs-orgmode Mailinglist --===============0567391850== Content-Type: multipart/alternative; boundary=001636c5b3c7f1705f0496788840 --001636c5b3c7f1705f0496788840 Content-Type: text/plain; charset=ISO-8859-1 For the Mac, I've been actually using the methods described in http://jcardente.blogspot.com/2010/09/saving-weblinks-to-org-mode-from-safari.html with pretty good success. If you're not shy about AppleScript and editting an XML file, it works great. Luke On Tue, Nov 30, 2010 at 1:21 AM, Konrad Hinsen wrote: > On 30 Nov 2010, at 03:53, Timothy Brown wrote: > > I think the intended behavior i'm confused about is remember coming up >> instead of the new capture functionality. I assume that has to do with >> this line here in the Applescript: >> >> set theProtocol to "org-protocol:/mac-remember:/y/" >> >> but i'm not sure how to modify this to forego the older remember >> functionality and use the newer capture functionality. >> > > That would require new code in org-mac-protocol.el. mac-remember is a new > protocol implemented in that module, which uses the remember framework. > Switching to capture would require defining a new protocol mac-capture and > implement it. > > I have actually started doing that and my current version is already > usable. But I am not happy yet with some of the details. If you want to try > it, my version of org-mac-protocol.el is attached, as well as > org-capture.scpt that calls it. > > Konrad. > > > > > > > > (* > org-capture.scpt --- make a note in an org-mode file, linking to the front > document and any selected text > > Copyright (C) 2009, 2010 Christopher Suckling > > Author: Christopher Suckling > > This file is Free Software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 3, or (at your option) > any later version. > > It is distributed in the hope that it will be useful, but WITHOUT > ANY WARRANTY; without even the implied warranty of MERCHANTABILITY > or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public > License for more details. > > You should have received a copy of the GNU General Public License > along with GNU Emacs; see the file COPYING. If not, write to the > Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, > Boston, MA 02110-1301, USA. > > Vesion: 0.634 > > Commentary > > Part of org-mac-protocol > > Installation > > 1) Open in AppleScript Editor > 2) Save as File Format: Script in ~/Library/Scripts/ > > Please see org-mac-protocol.org for full installation and usage > instructions > *) > > set ASTID to AppleScript's text item delimiters > set text item delimiters to {":"} > set myPath to (path to me) as text > set orgQSLib to (text items 1 through -2 of myPath) & "orgQSLib:" as text > set AppleScript's text item delimiters to ASTID > > set getEmacsLib to (load script file ((orgQSLib as text) & > "getEmacsClient.scpt")) > set getItemMetaLib to (load script file ((orgQSLib as text) & > "getItemMetadata.scpt")) > global escapeLib > set escapeLib to ((orgQSLib as text) & "escape.rb") > set theProtocol to "org-protocol:/mac-capture:/w/" > > tell application "System Events" > set theApp to item 1 of (get name of processes whose frontmost is > true) > end tell > > set theScript to getEmacsLib's getEmacsClient() & " " & getItemMetaLib's > getItemMetadata(theProtocol, theApp) > > do shell script theScript > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > --001636c5b3c7f1705f0496788840 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
For the Mac, I've been actually using the methods described in=A0<= a href=3D"http://jcardente.blogspot.com/2010/09/saving-weblinks-to-org-mode= -from-safari.html">http://jcardente.blogspot.com/2010/09/saving-weblinks-to= -org-mode-from-safari.html=A0with pretty good success. If you're no= t shy about AppleScript and editting an XML file, it works great.

Luke


On Tue, Nov 30, 2010 at 1:21 AM, Konrad = Hinsen <= konrad.hinsen@fastmail.net> wrote:
On 30 Nov 2010, at 03:53, Timothy Brown wrote:

I think the intended behavior i'm confused about is remember coming up<= br> instead of the new capture functionality. =A0I assume that has to do with this line here in the Applescript:

set theProtocol to "org-protocol:/mac-remember:/y/"

but i'm not sure how to modify this to forego the older remember
functionality and use the newer capture functionality.

That would require new code in org-mac-protocol.el. mac-remember is a new p= rotocol implemented in that module, which uses the remember framework. Swit= ching to capture would require defining a new protocol mac-capture and impl= ement it.

I have actually started doing that and my current version is already usable= . But I am not happy yet with some of the details. If you want to try it, m= y version of org-mac-protocol.el is attached, as well as org-capture.scpt t= hat calls it.

Konrad.







(*
org-capture.scpt --- make a note in an org-mode file, linking to the front<= br> document and any selected text

Copyright (C) 2009, 2010 Christopher Suckling

Author: Christopher Suckling <suckling at gmail dot com>

This file is Free Software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

It is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. =A0See the GNU General Public
License for more details.

You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. =A0If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.

Vesion: 0.634

Commentary

Part of org-mac-protocol

Installation

1) Open in AppleScript Editor
2) Save as File Format: Script in =A0~/Library/Scripts/

Please see org-ma= c-protocol.org for full installation and usage instructions
*)

set ASTID to AppleScript's text item delimiters
set text item delimiters to {":"}
set myPath to (path to me) as text
set orgQSLib to (text items 1 through -2 of myPath) & "orgQSLib:&q= uot; as text
set AppleScript's text item delimiters to ASTID

set getEmacsLib to (load script file ((orgQSLib as text) & "getEma= csClient.scpt"))
set getItemMetaLib to (load script file ((orgQSLib as text) & "get= ItemMetadata.scpt"))
global escapeLib
set escapeLib to ((orgQSLib as text) & "escape.rb")
set theProtocol to "org-protocol:/mac-capture:/w/"

tell application "System Events"
=A0 =A0 =A0 =A0set theApp to item 1 of (get name of processes whose frontm= ost is true)
end tell

set theScript to getEmacsLib's getEmacsClient() & " " &am= p; getItemMetaLib's getItemMetadata(theProtocol, theApp)

do shell script theScript
______________________________________________= _
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


--001636c5b3c7f1705f0496788840-- --===============0567391850== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0567391850==--