Guest User

Untitled

a guest
Mar 14th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #!/usr/bin/osascript
  3. --this line checks if Things is running when this script is launched
  4. tell application "System Events" to set alreadyrunning to exists (processes where name is "Things")
  5.  
  6. --this makes a line break between todos
  7. set AppleScript's text item delimiters to {(ASCII character 10)}
  8.  
  9. tell application "Things"
  10.    
  11.     log completed now --don't want to see completed tasks
  12.     if not alreadyrunning then quit --if ran by me then quit
  13.    
  14.     set the_output to ""
  15.    
  16.     repeat with ar in areas
  17.         set the_output to the_output & name in ar & return
  18.         set current_area to name in ar
  19.        
  20.         -- This is the part where I want to get items from this area that are only in "Today" (or just uncompleted ones)
  21.         repeat with aTodo in to dos of area current_area
  22.             set the_output to the_output & "  - " & name in aTodo & return
  23.         end repeat
  24.     end repeat
  25.    
  26.     return the_output
  27.    
  28. end tell
Add Comment
Please, Sign In to add comment