Hi all,
I use Mail Drop a lot but the problem is that additional information like @context
and ::Project
isn’t parsed.
My idea is to re-parse the selected task(s) in the inbox:
tell application "OmniFocus"
-- Target the content of the front window
tell content of front window
-- Retrieve every selected task
set theTasks to value of every selected tree
-- Notify the user if no tasks are selected
if theTasks = {} then
display alert "Unable to swap selected task names and notes." message "No tasks were selected. Please select one or more OmniFocus tasks and try again." as warning
return
end if
display alert "Ready to Swap Selected Task Names and Notes?" message "Once you do this, you will loose any formatting applied to your notes." buttons {"Cancel", "Continue"} cancel button "Cancel"
repeat with aTask in theTasks
tell aTask
set theText to name & return & note
end tell
tell application "OmniFocus"
parse tasks into default document with transport text theText
end tell
delete aTask
end repeat
end tell
end tell
There are some problems with this script:
- The second
tell application "OmniFocus"
(Line 33) looks wrong to me but I couldn’t make it work without it. - When the parse ends with an error the task is gone.
- The usage of multiple pieces like
@context ::Project
doesn’t work.
Any ideas to solve these problems?
Regards,
Reto