document.open();document.writeln('<div onmouseover="document.getElementById(\'snipt-4204\').style.display = \'block\'; return false;" onmouseout="document.getElementById(\'snipt-4204\').style.display = \'none\'; return false;" style="position: relative;">');document.writeln('<div class="highlight" style="background: #202020"><pre style="-moz-border-radius: 5px; border-radius: 5px; -webkit-border-radius: 5px; margin: 0; display: block; font: 11px Monaco, monospace !important; padding: 15px; background-color: #1C1C1C; overflow: auto; color: #D0D0D0;; line-height: 125%"><span style="color: #6ab825; font-weight: normal">tell</span> <span style="color: #24909d">application</span> <span style="color: #ed9d13">&quot;Safari&quot;</span>');document.writeln('	<span style="color: #6ab825; font-weight: normal">set</span> <span style="color: #40ffff">itemTitle</span> <span style="color: #6ab825; font-weight: normal">to</span> <span style="color: #40ffff">do</span> <span style="color: #40ffff">JavaScript</span> <span style="color: #ed9d13">&quot;document.title&quot;</span> <span style="color: #6ab825; font-weight: normal">in</span> <span style="color: #24909d">front</span> <span style="color: #bbbbbb">document</span>');document.writeln('	<span style="color: #6ab825; font-weight: normal">set</span> <span style="color: #40ffff">theURL</span> <span style="color: #6ab825; font-weight: normal">to</span> <span style="color: #40ffff">URL</span> <span style="color: #6ab825; font-weight: normal">of</span> <span style="color: #24909d">front</span> <span style="color: #bbbbbb">document</span>');document.writeln('<span style="color: #6ab825; font-weight: normal">end</span> <span style="color: #6ab825; font-weight: normal">tell</span>');document.writeln('');document.writeln('<span style="color: #999999; font-style: italic">-- show a prompt for a link title</span>');document.writeln('<span style="color: #24909d">display dialog</span> <span style="color: #ed9d13">&quot;Enter a title:&quot;</span> <span style="color: #40ffff">default</span> <span style="color: #40ffff">answer</span> <span style="color: #40ffff">theURL</span>');document.writeln('<span style="color: #6ab825; font-weight: normal">set</span> <span style="color: #40ffff">dialogInfo</span> <span style="color: #6ab825; font-weight: normal">to</span> <span style="color: #40ffff">result</span>');document.writeln('<span style="color: #6ab825; font-weight: normal">set</span> <span style="color: #40ffff">selectedButton</span> <span style="color: #6ab825; font-weight: normal">to</span> <span style="color: #bbbbbb">button returned</span> <span style="color: #6ab825; font-weight: normal">of</span> <span style="color: #40ffff">dialogInfo</span>');document.writeln('<span style="color: #6ab825; font-weight: normal">get</span> <span style="color: #40ffff">selectedButton</span>');document.writeln('<span style="color: #6ab825; font-weight: normal">set</span> <span style="color: #40ffff">theText</span> <span style="color: #6ab825; font-weight: normal">to</span> <span style="color: #bbbbbb">text returned</span> <span style="color: #6ab825; font-weight: normal">of</span> <span style="color: #40ffff">dialogInfo</span>');document.writeln('');document.writeln('<span style="color: #999999; font-style: italic">-- setup the link text for org mode</span>');document.writeln('<span style="color: #6ab825; font-weight: normal">set</span> <span style="color: #40ffff">dat</span> <span style="color: #6ab825; font-weight: normal">to</span> <span style="color: #d0d0d0">(</span><span style="color: #24909d">current date</span><span style="color: #d0d0d0">)</span> <span style="color: #6ab825; font-weight: normal">as </span><span style="color: #447fcf; text-decoration: underline">text</span>');document.writeln('<span style="color: #6ab825; font-weight: normal">set</span> <span style="color: #40ffff">crlf</span> <span style="color: #6ab825; font-weight: normal">to</span> <span style="color: #d0d0d0">(</span><span style="color: #24909d">ASCII character</span> <span style="color: #3677a9">13</span><span style="color: #d0d0d0">)</span> <span style="color: #d0d0d0">&amp;</span> <span style="color: #d0d0d0">(</span><span style="color: #24909d">ASCII character</span> <span style="color: #3677a9">10</span><span style="color: #d0d0d0">)</span>');document.writeln('<span style="color: #6ab825; font-weight: normal">set</span> <span style="color: #40ffff">theAppend</span> <span style="color: #6ab825; font-weight: normal">to</span> <span style="color: #40ffff">crlf</span> <span style="color: #d0d0d0">&amp;</span> <span style="color: #ed9d13">&quot;*** [[&quot;</span> <span style="color: #d0d0d0">&amp;</span> <span style="color: #40ffff">theURL</span> <span style="color: #d0d0d0">&amp;</span> <span style="color: #ed9d13">&quot;][&quot;</span> <span style="color: #d0d0d0">&amp;</span> <span style="color: #40ffff">theText</span> <span style="color: #d0d0d0">&amp;</span> <span style="color: #ed9d13">&quot;]] &quot;</span> <span style="color: #d0d0d0">&amp;</span> <span style="color: #40ffff">dat</span>');document.writeln('');document.writeln('<span style="color: #999999; font-style: italic">-- setup the path and save the string to the end of the file</span>');document.writeln('<span style="color: #6ab825; font-weight: normal">set</span> <span style="color: #40ffff">theFilePath</span> <span style="color: #6ab825; font-weight: normal">to</span> <span style="color: #ed9d13">&quot;Macintosh HD:Users:greg:gtd:&quot;</span> <span style="color: #d0d0d0">&amp;</span> <span style="color: #ed9d13">&quot;greg.org&quot;</span> <span style="color: #6ab825; font-weight: normal">as </span><span style="color: #447fcf; text-decoration: underline">string</span>');document.writeln('<span style="color: #6ab825; font-weight: normal">set</span> <span style="color: #40ffff">open_file</span> <span style="color: #6ab825; font-weight: normal">to</span> <span style="color: #24909d">open for access</span> <span style="color: #40ffff">theFilePath</span> <span style="color: #40ffff">with</span> <span style="color: #24909d">write</span> <span style="color: #40ffff">permission</span>');document.writeln('<span style="color: #24909d">write</span> <span style="color: #40ffff">theAppend</span> <span style="color: #6ab825; font-weight: normal">to</span> <span style="color: #40ffff">open_file</span> <span style="color: #40ffff">starting</span> <span style="color: #24909d">at</span> <span style="color: #40ffff">eof</span>');document.writeln('<span style="color: #24909d">close access</span> <span style="color: #40ffff">open_file</span>');document.writeln('');document.writeln('<span style="color: #999999; font-style: italic">-- have growl tell you that it worked</span>');document.writeln('<span style="color: #6ab825; font-weight: normal">tell</span> <span style="color: #24909d">application</span> <span style="color: #ed9d13">&quot;GrowlHelperApp&quot;</span>');document.writeln('	<span style="color: #6ab825; font-weight: normal">set</span> <span style="color: #24909d">the</span> <span style="color: #40ffff">allNotificationsList</span> <span style="color: #6ab825; font-weight: normal">to</span> <span style="color: #d0d0d0">{</span><span style="color: #ed9d13">&quot;Success Notification&quot;</span><span style="color: #d0d0d0">}</span>');document.writeln('	<span style="color: #6ab825; font-weight: normal">set</span> <span style="color: #24909d">the</span> <span style="color: #40ffff">enabledNotificationsList</span> <span style="color: #6ab825; font-weight: normal">to</span> <span style="color: #d0d0d0">{</span><span style="color: #ed9d13">&quot;Success Notification&quot;</span><span style="color: #d0d0d0">}</span>');document.writeln('	');document.writeln('	<span style="color: #24909d">register</span> <span style="color: #6ab825; font-weight: normal">as</span> <span style="color: #24909d">application</span> <span style="color: #ed9d13">¬</span>');document.writeln('		<span style="color: #ed9d13">&quot;Safari to Emacs Org Mode Script&quot;</span> <span style="color: #40ffff">all</span> <span style="color: #40ffff">notifications</span> <span style="color: #40ffff">allNotificationsList</span> <span style="color: #ed9d13">¬</span>');document.writeln('		<span style="color: #40ffff">default</span> <span style="color: #40ffff">notifications</span> <span style="color: #40ffff">enabledNotificationsList</span> <span style="color: #ed9d13">¬</span>');document.writeln('		<span style="color: #40ffff">icon</span> <span style="color: #6ab825; font-weight: normal">of</span> <span style="color: #24909d">application</span> <span style="color: #ed9d13">&quot;Safari&quot;</span>');document.writeln('	');document.writeln('	<span style="color: #40ffff">notify</span> <span style="color: #40ffff">with</span> <span style="color: #bbbbbb">name</span> <span style="color: #ed9d13">¬</span>');document.writeln('		<span style="color: #ed9d13">&quot;Success Notification&quot;</span> <span style="color: #bbbbbb">title</span> <span style="color: #ed9d13">¬</span>');document.writeln('		<span style="color: #ed9d13">&quot;Import Success&quot;</span> <span style="color: #40ffff">description</span> <span style="color: #ed9d13">&quot;Successfully imported \\&quot;&quot; &amp; itemTitle &amp; ¬</span>');document.writeln('<span style="color: #ed9d13">		&quot;</span><span style="color: #a61717; background-color: #e3d2d2">\\</span><span style="color: #ed9d13">&quot; to Emacs&quot;</span> <span style="color: #24909d">application</span> <span style="color: #bbbbbb">name</span> <span style="color: #ed9d13">&quot;Safari to Emacs Org Mode Script&quot;</span>');document.writeln('<span style="color: #6ab825; font-weight: normal">end</span> <span style="color: #6ab825; font-weight: normal">tell</span>');document.writeln('</pre></div>');document.writeln('');document.writeln('<div style="background-color: #111; color: #D0D0D0; float: right; padding: 5px 10px; -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; font: 11px Arial,Sans-Serif; display: none; position: absolute; bottom: 0; right: 0;" id="snipt-4204">code hosted by <a href="http://snipt.net/gregnewman/send-safari-url-to-emacs-org-mode" style="color: #0084FF; text-decoration: none;">snipt.net</a></div>');document.writeln('</div>');document.close();