November 2011
2 posts
Nearly Hygienic C Macros via __COUNTER__
A few months back Benjamin Stiglitz taught me that it’s finally possible to build practically-hygienic macros with modern plain ol’ C #defines. Here’s his example:
#define MIN_PASTE(A,B) A##B
#define MIN_IMPL(A,B,L) ({ \
__typeof__(A) MIN_PASTE(__a,L) = (A); \
__typeof__(B) MIN_PASTE(__b,L) = (B); \
MIN_PASTE(__a,L) < MIN_PASTE(__b,L) ? MIN_PASTE(__a,L) :...
2 tags
Copy OmniFocus Task Outline Text to Clipboard
Here’s a quick script that will take the selected tasks in OmniFocus 1.9.4 and put a simple space-indented text representation on the clipboard:
tell application "OmniFocus"
tell first document window of front document
set selectedItems to selected trees of content
if ((count of selectedItems) < 1) then
error "Please first select a task"
end if
...