Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

AppleScript

Clipboard to OmniFocus Inbox

1
2
3
4
5
6
7
8
set OFTask to the clipboard

tell application "OmniFocus"
	set theDoc to first document
	tell theDoc
		make new inbox task with properties {name:OFTask}
	end tell
end tell
https://snipt.net/embed/f6083d64a7fdbb241dce3ea24d7cd7f5/
https://snipt.net/raw/f6083d64a7fdbb241dce3ea24d7cd7f5/
f6083d64a7fdbb241dce3ea24d7cd7f5
applescript
AppleScript
8
2016-11-26T18:48:24
True
False
False
Aug 31, 2012 at 10:10 AM
/api/public/snipt/46560/
clipboard-to-omnifocus-inbox
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">set</span> <span class="nv">OFTask</span> <span class="k">to</span> <span class="nb">the clipboard</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="k">tell</span> <span class="nb">application</span> <span class="s2">&quot;OmniFocus&quot;</span> </span><span id="L-4"><a name="L-4"></a> <span class="k">set</span> <span class="nv">theDoc</span> <span class="k">to</span> <span class="nb">first</span> <span class="na">document</span> </span><span id="L-5"><a name="L-5"></a> <span class="k">tell</span> <span class="nv">theDoc</span> </span><span id="L-6"><a name="L-6"></a> <span class="nb">make</span> <span class="nb">new</span> <span class="nv">inbox</span> <span class="nv">task</span> <span class="nv">with</span> <span class="na">properties</span> <span class="p">{</span><span class="na">name</span><span class="p">:</span><span class="nv">OFTask</span><span class="p">}</span> </span><span id="L-7"><a name="L-7"></a> <span class="k">end</span> <span class="k">tell</span> </span><span id="L-8"><a name="L-8"></a><span class="k">end</span> <span class="k">tell</span> </span></pre></div> </td></tr></table>
applescript, clipboard, omnifocus

AppleScript

Strip formatting from clipboard content and paste

1
2
3
4
5
--By Don Southard aka @binaryghost
do shell script ("clip=`pbpaste`;tmp=`mktemp -t cp`.txt;echo $clip > $tmp;cat $tmp | pbcopy")
tell application id "com.apple.systemevents"
	keystroke "v" using {command down}
end tell
https://snipt.net/embed/ee92e4e72e004db96710281d199bf2b1/
https://snipt.net/raw/ee92e4e72e004db96710281d199bf2b1/
ee92e4e72e004db96710281d199bf2b1
applescript
AppleScript
5
2016-12-06T14:50:26
True
False
False
/api/public/snipt/29607/
strip-formatting-from-clipboard-content-and-paste
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c">--By Don Southard aka @binaryghost</span> </span><span id="L-2"><a name="L-2"></a><span class="nb">do shell script</span> <span class="p">(</span><span class="s2">&quot;clip=`pbpaste`;tmp=`mktemp -t cp`.txt;echo $clip &gt; $tmp;cat $tmp | pbcopy&quot;</span><span class="p">)</span> </span><span id="L-3"><a name="L-3"></a><span class="k">tell</span> <span class="nb">application</span> <span class="na">id</span> <span class="s2">&quot;com.apple.systemevents&quot;</span> </span><span id="L-4"><a name="L-4"></a> <span class="nv">keystroke</span> <span class="s2">&quot;v&quot;</span> <span class="nv">using</span> <span class="p">{</span><span class="nv">command</span> <span class="nv">down</span><span class="p">}</span> </span><span id="L-5"><a name="L-5"></a><span class="k">end</span> <span class="k">tell</span> </span></pre></div> </td></tr></table>
applescript

AppleScript

create sub-context in OmniFocus

1
2
3
4
5
6
7
tell context myWFContext
   if context firstName exists then
      set theContext to context firstName
   else
      set theContext to make new context with properties {name:firstName}
   end if
end tell
https://snipt.net/embed/b9825d5236a993744dc48eae3b68f7d2/
https://snipt.net/raw/b9825d5236a993744dc48eae3b68f7d2/
b9825d5236a993744dc48eae3b68f7d2
applescript
AppleScript
7
2016-11-24T08:20:20
True
False
False
/api/public/snipt/22937/
create-sub-context-in-omnifocus
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">tell</span> <span class="na">context</span> <span class="nv">myWFContext</span> </span><span id="L-2"><a name="L-2"></a> <span class="k">if</span> <span class="na">context</span> <span class="nv">firstName</span> <span class="nb">exists</span> <span class="k">then</span> </span><span id="L-3"><a name="L-3"></a> <span class="k">set</span> <span class="nv">theContext</span> <span class="k">to</span> <span class="na">context</span> <span class="nv">firstName</span> </span><span id="L-4"><a name="L-4"></a> <span class="k">else</span> </span><span id="L-5"><a name="L-5"></a> <span class="k">set</span> <span class="nv">theContext</span> <span class="k">to</span> <span class="nb">make</span> <span class="nb">new</span> <span class="na">context</span> <span class="nv">with</span> <span class="na">properties</span> <span class="p">{</span><span class="na">name</span><span class="p">:</span><span class="nv">firstName</span><span class="p">}</span> </span><span id="L-6"><a name="L-6"></a> <span class="k">end</span> <span class="k">if</span> </span><span id="L-7"><a name="L-7"></a><span class="k">end</span> <span class="k">tell</span> </span></pre></div> </td></tr></table>
applescript, context, omnifocus
Copyrighted, illegal, or inappropriate content? Email [email protected].