Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.