tried to get it to work with the tutorial but don’t succeded maybe because the code uses conditions (?).
Here’s the code, coul you help:
tell application "Journler"
set Now to (current date) --(- 2 * days)
set time of Now to 6 * 3600 -- 6 AM
set TD to entries of folder "Agenda GTD"
set TDF to name of folders of folder "Agenda GTD"
repeat with F in TDF
set TD to TD & entries of folder F
end repeat
repeat with anEntry in TD
set TG to ((date due of anEntry) - Now) / days
if TG < 0 then
get tags of anEntry
set oTags to tags of anEntry
set tags of anEntry to oTags & "Past Due"
set nTags to oTags & "Past Due"
get rich text of nTags
--if tags of anEntry contains "Oggi", "Domani", "2 Giorni", "Settimana, "Mese" then
---replace this tags with "Past Due"
--if tags of anEntry does not contain "Oggi", "Domani", "2 Giorni", "Settimana, ---"Mese" then
--set tags of anEntry to oTags & "Past Due"
else if TG > 0 and TG < 1 then
set tags of anEntry to "Oggi"
else if TG > 1 and TG < 2 then
set tags of anEntry to "Domani"
else if TG > 2 and TG < 3 then
set tags of anEntry to "2 Giorni"
else if TG > 3 and TG < 7 then
set tags of anEntry to "Settimana"
else if TG > 7 and TG < 30 then
set tags of anEntry to "Mese"
else
set tags of anEntry to "Pending"
end if
end repeat
save
end tell
to delete a specified item from a list,
use something like this
property myList : {"oggi", "carrasco germán"}
set myList to deleteItemFromList(myList, "oggi")
on deleteItemFromList(theList, theItem)
if {theItem} is not in theList then return theList
set newList to {}
repeat with i in theList
if contents of i is not theItem then set end of newList to contents of i
end repeat
return newList
end deleteItemFromList