I have a .txt file entitled tasks.txt that contains all of my tasks in the following format:
@context action >project |start date-due date (although not all entries have projects or start/due dates).
Example:
@internet email mark >proposal -feb 8
@internet email scott >proposal |feb 4-feb 6
@internet lookup directions >proposal |feb 12
@errands pickup parcel
I would like to enter a search string (@internet, for example) into a script via Launchbar, and have the script dump into ‘current.txt’ only those lines that match the search string.
In current.txt, if the search was for a context (@internet) I would like the script to remove any lines whose start dates have not yet arrived, and remove just the start date itself of those that have arrived (not the entire line). Next it would sort the lines by due date and then alphabetically.
On the other hand, if the search was for a project (>proposal) then it would only remove the indiviual start dates that have arrived, while keeping the lines of the entries whose start dates have not yet arrived. Then sort again by date and then alphabetically.
Thus if I were to search for @internet today (feb 4), the following would be displayed from the above list:
@internet email scott >proposal -feb 6
@internet email mark >proposal -feb 8
And if I were to search for >proposal, the following would be displayed from the above list:
@internet email scott >proposal -feb 6
@internet email mark >proposal -feb 8
@internet lookup directions >proposal |feb 12
Unfortunately, my scripting ability is very limited. I have been researching for several days in attempts to develop something, but have been completely unsuccessful. It is beyond me. Any assistance would be appreciated.
Thank-you kindly.