Skip to content

Instantly share code, notes, and snippets.

@funkaoshi
Created March 11, 2010 01:50
Show Gist options
  • Save funkaoshi/328708 to your computer and use it in GitHub Desktop.
Save funkaoshi/328708 to your computer and use it in GitHub Desktop.
property archiveFilePath : "/Users/ramanan/Desktop/Text Files/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