Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save funkaoshi/313904 to your computer and use it in GitHub Desktop.
Save funkaoshi/313904 to your computer and use it in GitHub Desktop.
property archiveFilePath : "/Users/ramanan/Dropbox/SimpleText/Archive.taskpaper"
property archiveFileName : "Archive.taskpaper"
tell application "Finder"
if exists (archiveFilePath) as POSIX file then
tell application "TaskPaper"
-- save what the front most file is
set currentFile to front document
-- open archive file
open archiveFilePath
set archiveFile to document named archiveFileName
-- move archived tasks from current file to the archive file,
-- and delete the archive project
tell currentFile
move entries of project named "Archive" to end of entries of archiveFile
delete project named "Archive"
end tell
-- save and close archive file
tell archiveFile
save
close
end tell
end tell
end if
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment