The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Removing duplicates from OmniFocus

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Ryan Davis

Posts: 651
Nickname: zenspider
Registered: Oct, 2004

Ryan Davis is a ruby nerd.
Removing duplicates from OmniFocus Posted: Mar 14, 2008 11:53 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Ryan Davis.
Original Post: Removing duplicates from OmniFocus
Feed Title: Polishing Ruby
Feed URL: http://blog.zenspider.com/index.rdf
Feed Description: Musings on Ruby and the Ruby Community...
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Ryan Davis
Latest Posts From Polishing Ruby

Advertisement

Sometimes something (I suspect iSync) screws up and duplicates my tasks. This has proven useful:

tell application "OmniFocus"
  tell first document
    repeat with aContext in contexts
      set toDelete to {}
      set seen to {}
      repeat with aTask in tasks of aContext
        if seen contains name of aTask then
          set end of toDelete to id of aTask
        else
          set end of seen to name of aTask
        end if
      end repeat

      repeat with aTask in toDelete
        try
          delete (task id aTask)
        end try
      end repeat
      count of toDelete
    end repeat
  end tell
end tell

Read: Removing duplicates from OmniFocus

Topic: Remote cache pitfalls Previous Topic   Next Topic Topic: rubyforge version 0.4.5 has been released!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use