1 #+OPTIONS: H:3 num:nil toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t TeX:t LaTeX:t skip:nil d:(HIDE) tags:not-in-toc
2 #+STARTUP: align fold nodlcheck hidestars oddeven lognotestate
3 #+SEQ_TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@)
4 #+TAGS: Write(w) Update(u) Fix(f) Check(c)
5 #+TITLE: Org and Mac OS X
7 #+EMAIL: bzg AT altern DOT org
12 # This file is the default header for new Org files in Worg. Feel free
13 # to tailor it to your needs.
15 [[file:index.org][{Back to Worg's index}]]
17 Assorted hacks to interact with org-mode whilst working in OS X
18 applications other than Emacs...
20 * [[file:org-contrib/org-mac-maillink.org][org-mac-maillink]] -- linking to messages in OS X Microsoft Entourage app
21 A short Applescript/terminal hack that allows the user to create a link to a
22 message from within the Microsoft Entourage application and
23 paste it directly into an Org-mode file. The link uses the email's
24 subject line as its description.
25 Written by /Matt Strickland/.
27 * [[file:org-contrib/org-mac-iCal.org][org-mac-iCal]] -- import OS X iCal.app events into Emacs diary
28 Written by /Christopher Suckling/.
30 * [[file:org-contrib/org-mac-message.org][org-mac-message]] -- linking to messages in OS X Mail.app
31 Create links to selected or flagged messages in Mail.app.
32 Written by /John Wiegley/ and /Christopher Suckling/.
34 * org-mac-protocol -- interact with [[file:org-contrib/org-protocol.org][org-protocol]] from OS X applications
35 Written by /Christopher Suckling/.
39 A suite of scripts that allow the user to annotate their org-mode
40 buffers without switching focus from other OS X applications
43 The AppleScripts interface with org-protocol.el to extract content
44 from, and link to, documents and applications.
46 Three modes of interaction are provided:
48 =org-link= creates an org-mode link and adds it to =*Org Links*= and
51 =org-remember= pops up a small =*Remember*= frame with links and,
52 where possible, extracted content embedded.
54 =org-note= pops up a small =*Remember*= frame for note taking
55 independent of the document being worked on.
58 A disk image can be downloaded [[http://claviclaws.net/org/org-mac-protocol.dmg][here]].
60 A git repository can be found at =git://github.com/claviclaws/org-mac-protocol.git=
62 The git repository does not contain the [[http://homepage.mac.com/tkurita/scriptfactory/Softwares/OSAX/URIEscape/manual/en/index.html][URI Escape]] scripting addition.
66 - org-mac-protocol.pkg (installer package)
67 - sources (including Scripting Additions sources)
68 - org-mac-protocol.org (this manual)
72 - OS X 10.5 (untested on previous versions)
74 - [[http://orgmode.org][Org-Mode]] 6.28 or above (untested on previous versions)
75 - [[https://gna.org/p/remember-el][Remember]]
77 ** Installation and configuration
79 **** =org-mac-protocol.pkg= - OS X 10.5 only
81 - Launch the installer and follow on screen instructions. You
82 must set a location for org-mac-protocol.el that is on your
85 **** Manual installation - OS X 10.4
87 - Copy files from the =sources= directory to their relevant
90 =org-mac-protocol.el= should be placed on your Emacs load-path.
92 The contents of the =Scripts= directory should be placed in
95 =URI Escape.osax= should be placed in
96 =~/Library/ScriptingAdditions/=, creating the directory if
97 necessary. =URI Escape.osax= is found on the
98 =URIEscape1.1.2.dmg= disk image.
101 **** Require org-mac-protocol.el
103 : (require 'org-mac-protocol)
107 : (add-to-list 'org-modules 'org-mac-protocol)
109 Note that =org-modules= must be set before org-mode is loaded.
111 **** Start emacsserver
115 **** Create =*Remember*= templates
117 Two separate =*Remember*= templates are required, one for
118 =org-remember= and one for =org-note=:
120 : ("AppleScript remember" ?y "* %?\n\n Source: %u, %c\n\n %i" (concat org-directory "inbox.org") "Remember")
122 : ("AppleScript note" ?z "* %?\n\n Date: %u\n" (concat org-directory "inbox.org") "Notes")
124 These templates can be fairly flexible. The only essential items
125 are =?y= and =?z= respectively (the template selection
126 characters), and, for =org-remember=, =%c= (the link to the
127 document), and =%i= (the selection within the document).
129 If you choose to alter the template selection characters, you
130 *must* alter =theProtocol= variable in =org-remember.scpt= and
131 =org-note.scpt= to reflect your changes.
133 Please see the [[http://orgmode.org/manual/Remember-templates.html#Remember-templates][org manual]] and the [[http://orgmode.org/worg/org-contrib/org-protocol.php][org-protocol.el manual]] for
134 further details on template customisation.
137 *** Edit orgQSLib/getEmacsClient.scpt
139 - Set =theEmacsClient= to point to emacsclient for your flavour of Emacs.
141 The default setting should work with CVS Emacs and Carbon Emacs.
142 Aquamacs users will have to edit this variable.
145 There are three scripts that can be invoked; =org-link=,
146 =org-note=, and =org-remember=. These scripts can be called by
147 various methods, for example, the [[file://Applications/AppleScript/AppleScript%20Utility.app/][Script menu]] in the menu bar,
148 [[http://code.google.com/p/blacktree-alchemy/][Quicksilver]], [[http://www.red-sweater.com/fastscripts/][FastScripts]] etc.
150 *** Currently supported applications
152 | | org-link | org-note | org-remember |
153 |----------+--------------------+----------+----------------------------------|
154 | Finder | Link: file | Yes | Content: no |
155 | Safari | Link: URL | Yes | Content: current selection |
156 | Mail | Link: message | Yes | Content: entire message |
157 | Skim | Link: PDF | Yes | Content: current selection |
158 | BibDesk | Link: entry | Yes | Content: Harvard style citation |
159 | Terminal | Link: Terminal.app | Yes | Content: current window contents |
162 - Unsupported applications that are AppleScript aware will attempt
163 to create links to the front document, but do not support
166 - Preview.app is /not/ AppleScript aware and Firefox has such
167 limited AppleScript support as to be useless.
170 Creates an org-mode link from the front document and passes it to
171 emacsclient, adding it to =*Org Links*= and the kill-ring.
176 Creates a note in an org-mode buffer. Does not link to the front
180 - Enter note in pop-up =*Remember*= buffer
181 - File note to return to previous application
184 Creates a note in an org-mode buffer. Links to the file of the
185 front document, and uses selection in front document as
186 initial content of the =*Remember*= buffer.
189 - Enter note in pop-up =*Remember*= buffer
190 - File note to return to previous application
193 Support for further applications will also require defining [[http://orgmode.org/manual/Adding-hyperlink-types.html#Adding-hyperlink-types][new
194 org-mode hyperlinks]], as will improvements to linking for PDF files
195 and Terminal. Planned support includes:
197 - [ ] Skim (improved)
198 - [ ] Terminal (improved)
200 - [ ] Microsoft Office
203 - [ ] Firefox (if AppleScript support is improved)
207 The pop up remember buffer is developed from a blog post by [[http://metajack.im/2008/12/30/gtd-capture-with-emacs-orgmode/][Jack Moffitt]].
209 [[http://homepage.mac.com/tkurita/scriptfactory/Softwares/OSAX/URIEscape/manual/en/index.html][URI Escape]] is by Tetsuro Kurita.
211 org-info.js and CSS stylesheet by [[http://orgmode.org/worg/code/org-info-js/][Sebastian Rose]]